Hi all, Sorry if this message turns up twice. I couldn''t see my message on the list. I recently updated from rails 0.13.1 to 0.14.2, and my 0.13.1-generated app is breaking in a couple of places. First, rails used to pluralize ''status'' as status itself, apparently it was fixed to be recognized as ''statuses'' now. I thought changing my table name to ''statuses'' would fix the problem. It did in some places, but the status listing doesn''t work any longer. Here''s the error: uninitialized constant Statu And at the end of the trace, it says this: This error occured while loading the following files: statu.rb Any idea how I can fix this? TIA, Vamsee.
Can somebody please, please look into this? I''m lost, and I can''t deploy the next version of my app because of this problem. Thanks, Vamsee. Vamsee Kanakala wrote:> Hi all, > > Sorry if this message turns up twice. I couldn''t see my message > on the list. I recently updated from rails 0.13.1 to 0.14.2, and my > 0.13.1-generated app is breaking in a couple of places. First, rails > used to pluralize ''status'' as status itself, apparently it was fixed > to be recognized as ''statuses'' now. I thought changing my table name > to ''statuses'' would fix the problem. It did in some places, but the > status listing doesn''t work any longer. Here''s the error: > > uninitialized constant Statu > > And at the end of the trace, it says this: > > This error occured while loading the following files: > statu.rb > > Any idea how I can fix this? > > TIA, > Vamsee. > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails > >-- If you''re not living on the edge, you''re taking up too much room - Jayne Howard
On 10/29/05, Vamsee Kanakala <vamlists-hi6Y0CQ0nG0@public.gmane.org> wrote:> Hi all, > > Sorry if this message turns up twice. I couldn''t see my message on > the list. I recently updated from rails 0.13.1 to 0.14.2, and my > 0.13.1-generated app is breaking in a couple of places. First, rails > used to pluralize ''status'' as status itself, apparently it was fixed to > be recognized as ''statuses'' now. I thought changing my table name to > ''statuses'' would fix the problem. It did in some places, but the status > listing doesn''t work any longer. Here''s the error: > > uninitialized constant Statu > > And at the end of the trace, it says this: > > This error occured while loading the following files: > statu.rb > > Any idea how I can fix this?You could try to edit your environnement.rb file and modify the inflection section after the main config: it should look like this at the moment # Add new inflection rules using the following format # (all these examples are active by default): # Inflector.inflections do |inflect| # inflect.plural /^(ox)$/i, ''\1en'' # inflect.singular /^(ox)en/i, ''\1'' # inflect.irregular ''person'', ''people'' # inflect.uncountable %w( fish sheep ) # end [Warn : untested] Inflector.inflections do |inflect| inflect.plural /^(status)$/,''\1es'' inflect.singulare /^(status)es$, ''\1'' end but more probably you will want to keep the name status for your table right ? then maybe something like ... Inflector.inflections do |inflect| inflect.plural/^(status)$/,''\1'' inflect.singular /^(status)s$, ''\1'' end Jean
Jean Helou wrote:> Inflector.inflections do |inflect| > inflect.plural /^(status)$/,''\1es'' > inflect.singulare /^(status)es$, ''\1'' >end > >Hi Jean, thanks for replying, I made some little changes (it didn''t work as it is) to your code and put this in: Inflector.inflections do |inflect| inflect.plural /^(status)$/i,''\1es'' inflect.singular /^(status)es/i, ''\1'' end and restarted the app, but still no luck :( Vamsee.
On 10/29/05, Vamsee Kanakala <vamlists-hi6Y0CQ0nG0@public.gmane.org> wrote:> Jean Helou wrote: > > > Inflector.inflections do |inflect| > > inflect.plural /^(status)$/,''\1es'' > > inflect.singulare /^(status)es$, ''\1'' > >end > > > > > Hi Jean, thanks for replying, I made some little changes (it didn''t work > as it is) to your code and put this in: > > Inflector.inflections do |inflect| > inflect.plural /^(status)$/i,''\1es'' > inflect.singular /^(status)es/i, ''\1'' > end > > and restarted the app, but still no luck :(Well, this should be the way to go, if you haven''t looked at it yet maybe the documentation will shed some light: http://api.rubyonrails.com/classes/Inflector/Inflections.html I would try irregular but I am surprised that what you tried didn''t work if your table is still called statuses ... Jean
Jean Helou wrote:>Well, this should be the way to go, if you haven''t looked at it yet >maybe the documentation will shed some light: >http://api.rubyonrails.com/classes/Inflector/Inflections.html > >I would try irregular but I am surprised that what you tried didn''t >work if your table is still called statuses ... > >Yes, it''s still named statuses, surprisingly the listing works if I change paginate directive to plural: def list @status_pages, @statuses = paginate :statuses, :per_page => 10 end I''m not completely sure as to why it started working now, but I''m glad it does. Thanks for the help. Vamsee.