I have a pluralization that is not being picked up correctly. The plural of "equipment" is "equipment", not "equipments". This is a special case, as the plural of "shipment" is in fact "shipments". I can get around this by specifying the table name "equipment" in my model class, but is there a way for me to append the pluralization rules so that the correct plural is picked up in other places, e.g. "has_many: equipment" instead of "has_many :equipments"? thanks! Jeff
> I have a pluralization that is not being picked up correctly. The > plural of "equipment" is "equipment", not "equipments". This is aAfter some brain racking, I''m unsure if there even is a singular version of "equipment"? I wouldn''t think "equipment" is both plural/singular.. I see it as a collective term, describing a group. I''ve never tried to refer to a single object as a(n) "equipment". Speaking pluralizations that don''t work, though.. I ran into "aliases" today. It tried to make the singular version "aliase".. which was a little confusing for a few moments! Cheers, Ryan
On 6/24/05, Ryan Christensen <ryanpc-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > I have a pluralization that is not being picked up correctly. The > > plural of "equipment" is "equipment", not "equipments". This is a > > After some brain racking, I''m unsure if there even is a singular > version of "equipment"? I wouldn''t think "equipment" is both > plural/singular.. I see it as a collective term, describing a group. > I''ve never tried to refer to a single object as a(n) "equipment".How about "look at that expensive ''piece of equipment''"?
Dennis Sutch wrote:>On 6/24/05, Ryan Christensen <ryanpc-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > >>>I have a pluralization that is not being picked up correctly. The >>>plural of "equipment" is "equipment", not "equipments". This is a >>> >>> >>After some brain racking, I''m unsure if there even is a singular >>version of "equipment"? I wouldn''t think "equipment" is both >>plural/singular.. I see it as a collective term, describing a group. >>I''ve never tried to refer to a single object as a(n) "equipment". >> >> > >How about "look at that expensive ''piece of equipment''"? >_______________________________________________ >Rails mailing list >Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >http://lists.rubyonrails.org/mailman/listinfo/rails > >I came to the same conclusion, but then you''ve put the burden of plurality on the ''piece'' rather than the ''equipment''. You would now refer to one ''piece of equipment'' and several ''pieces of equipment'' and now we really just sidestep the whole issue of what the plural of equipment actually is. Or perhaps the real issue at stake is not what the plural is, but even if the word actually HAS a plural. Besides all this, nobody wants to have and belong to many :pieces_of_equipment. I advise a new table name, and then my brain can stop hurting :-) Ben No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.323 / Virus Database: 267.8.0/27 - Release Date: 6/23/2005 _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
Hmmm.... I would suggest a way for a model class to specify its own plural name, e.g. "plural_name :equipment" the same way you can do "table_name :equipment". Or else having the singular class name be a fallback if the plural is not found in a usage like "has_many". -jeff On Jun 24, 2005, at 4:04 PM, Ben Robison wrote:> Dennis Sutch wrote: > >> On 6/24/05, Ryan Christensen <ryanpc-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> >>>> I have a pluralization that is not being picked up correctly. >>>> The plural of "equipment" is "equipment", not "equipments". This >>>> is a >>>> >>> After some brain racking, I''m unsure if there even is a singular >>> version of "equipment"? I wouldn''t think "equipment" is both >>> plural/singular.. I see it as a collective term, describing a >>> group. I''ve never tried to refer to a single object as a(n) >>> "equipment". >>> >> How about "look at that expensive ''piece of equipment''"? >> _______________________________________________ Rails mailing list >> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/ >> listinfo/rails >> > I came to the same conclusion, but then you''ve put the burden of > plurality on the ''piece'' rather than the ''equipment''. You would > now refer to one ''piece of equipment'' and several ''pieces of > equipment'' and now we really just sidestep the whole issue of what > the plural of equipment actually is. Or perhaps the real issue at > stake is not what the plural is, but even if the word actually HAS > a plural. > > Besides all this, nobody wants to have and belong to > many :pieces_of_equipment. > > I advise a new table name, and then my brain can stop hurting :-) > > Ben > > > No virus found in this outgoing message. > Checked by AVG Anti-Virus. > Version: 7.0.323 / Virus Database: 267.8.0/27 - Release Date: > 6/23/2005 > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails > >