Weird table pluralization problem

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…

I think the plural of “equipment” in English is identical to the
singular.

Either that or “equipment”, like “water”, doesn’t really have singular.

Alder G. 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 ^^

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 7/21/06, [email protected] [email protected] 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’?)

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs