I just got this error: uninitialized constant PriceCurf After much head scratching I remembered the Rails plural to singular mapping rules. My table is price_curves, my object is PriceCurve ... whereas I am guessing Rails thinks the singular ought to br PriceCurf ?! I''m sure there is a simple way around this linguistic blunder that doesn''t involve the use of pigeon English. Funny though. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060328/f06df3b4/attachment.html
Sean Blezard wrote:> I just got this error: > > uninitialized constant PriceCurf > > After much head scratching I remembered the Rails plural to singular > mapping rules. My table is price_curves, my object is PriceCurve ... > whereas I am guessing Rails thinks the singular ought to br PriceCurf > ?! > > I''m sure there is a simple way around this linguistic blunder that > doesn''t involve the use of pigeon English. > > Funny though.Check http://api.rubyonrails.org/classes/Inflector/Inflections.html to see how you can add exceptions to the rules Rails uses for the tranformations from class to table names and such... Michael
Just adding the :class_name parameter seems to override the default inference. That''s a very acceptable work around. On 28/03/06, Sean Blezard <sean.blezard@gmail.com> wrote:> > I just got this error: > > uninitialized constant PriceCurf > > After much head scratching I remembered the Rails plural to singular mapping rules. My table is price_curves, my object is PriceCurve ... whereas I am guessing Rails thinks the singular ought to br PriceCurf ?! > > > I''m sure there is a simple way around this linguistic blunder that doesn''t involve the use of pigeon English. > > Funny though. > > >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060328/a22a7780/attachment.html