Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ruby on Rails Plural Model Name

Tags:

I have a domain model that represents flight rules. Flight rules are a collection of regulations under which a flight is performed. Visual Flight Rules, or VFR is one such example. I am trying to scaffold this model, but Rails insists on making FlightRules singular (FlightRule), while I need it to remain plural. Is there any way of having Rails keep the model name plural?

like image 823
Laurens Avatar asked Dec 15 '11 17:12

Laurens


1 Answers

You have to edit your inflections.rb file under config/initializers/inflections.rb

ActiveSupport::Inflector.inflections do |inflect|   inflect.uncountable %w(flight_rules) end 
like image 160
klaffenboeck Avatar answered Oct 06 '22 19:10

klaffenboeck