When I created a new project and a "equipment" model for an unknown reason to me rails tried to query the table "equipment" and not "equipments", does someone know why it did that ? So I added set_table_name "equipments" in the model class and it now works but I don''t really understand why it is required in the first place... -- Posted via http://www.ruby-forum.com/.
I think the plural of "equipment" in English is identical to the singular. Either that or "equipment", like "water", doesn''t really have singular. On 7/21/06, Julien Schmurfy <schmurfy@gmail.com> wrote:> When I created a new project and a "equipment" model for an unknown > reason to me rails tried to query the table "equipment" and not > "equipments", does someone know why it did that ? > > So I added > set_table_name "equipments" > in the model class and it now works but I don''t really understand why it > is required in the first place... > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-- -Alder
Alder Green wrote:> I think the plural of "equipment" in English is identical to the > singular. > > Either that or "equipment", like "water", doesn''t really have singular.Too bad I didn''t even thought of that :x thanks for your answer ^^ -- Posted via http://www.ruby-forum.com/.
In the inflections file (the file which determins singular and plural names... on my computer it is ruby/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/inflections.rb) there is a line like this: inflect.uncountable(%w(equipment information rice money species series fish sheep)) So there you go. Equipment is one of the words that rails doesn''t give a plural for. -Nathan On 21/07/06, Julien Schmurfy <schmurfy@gmail.com> wrote:> Alder Green wrote: > > I think the plural of "equipment" in English is identical to the > > singular. > > > > Either that or "equipment", like "water", doesn''t really have singular. > > Too bad I didn''t even thought of that :x > thanks for your answer ^^ > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
On 7/21/06, njmacinnes@gmail.com <njmacinnes@gmail.com> wrote:> In the inflections file (the file which determins singular and plural > names... on my computer it is > ruby/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/inflections.rb) > there is a line like this: > > inflect.uncountable(%w(equipment information rice money species series > fish sheep))Yeah, that''s the proper name for stuff like "equipment" and "water" : Uncountable nouns. Interesting that some Railers need Sheep, Fish and Rice models. Why would they document attributes of specific sheep? What''s to document, even? (:name => ''dolly''?)> So there you go. Equipment is one of the words that rails doesn''t give > a plural for. > > -Nathan > > On 21/07/06, Julien Schmurfy <schmurfy@gmail.com> wrote: > > Alder Green wrote: > > > I think the plural of "equipment" in English is identical to the > > > singular. > > > > > > Either that or "equipment", like "water", doesn''t really have singular. > > > > Too bad I didn''t even thought of that :x > > thanks for your answer ^^ > > > > -- > > Posted via http://www.ruby-forum.com/. > > _______________________________________________ > > Rails mailing list > > Rails@lists.rubyonrails.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-- -Alder