I want to turn off table name pluralization, so I''ve added ActiveRecord::Base.pluralize_table_names = false at the end on my config/environment.rb But I am getting an uninitialized constant error from paginator. uninitialized constant Wherei /usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/ dependencies.rb:266:in `load_missing_constant'' /usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/ dependencies.rb:452:in `const_missing'' /usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/ dependencies.rb:464:in `const_missing'' /usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/ inflector.rb:250:in `constantize'' /usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/ core_ext/string/inflections.rb:148:in `constantize'' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/ pagination.rb:195:in `paginator_and_collection_for'' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/ pagination.rb:130:in `paginate'' app/controllers/admin_controller.rb:12:in `list'' My table name is ''whereis'' and this seems to indicate that Rails is trying to get the model name by removing the plural from the table name. It would be helpful to know how to test whether table name pluralization was turned off or whether I''ve missed a step it disabling pluralization. I have not any documentation on this. Thanks Dave --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
You did restart the server/console after modifying environment.rb right? On May 8, 11:52 am, Dave <dfdumar...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I want to turn off table name pluralization, so I''ve added > > ActiveRecord::Base.pluralize_table_names = false > > at the end on my config/environment.rb > > But I am getting an uninitialized constant error from paginator. > > uninitialized constant Wherei > > /usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/ > dependencies.rb:266:in `load_missing_constant'' > /usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/ > dependencies.rb:452:in `const_missing'' > /usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/ > dependencies.rb:464:in `const_missing'' > /usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/ > inflector.rb:250:in `constantize'' > /usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/ > core_ext/string/inflections.rb:148:in `constantize'' > /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/ > pagination.rb:195:in `paginator_and_collection_for'' > /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/ > pagination.rb:130:in `paginate'' > app/controllers/admin_controller.rb:12:in `list'' > > My table name is ''whereis'' and this seems to indicate that Rails is > trying to get the model name by removing the plural from the table > name. > > It would be helpful to know how to test whether table name > pluralization was turned off or whether I''ve missed a step it > disabling pluralization. I have not any documentation on this. > > Thanks > Dave--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
> My table name is ''whereis'' and this seems to indicate that Rails is > trying to get the model name by removing the plural from the table > name. > > It would be helpful to know how to test whether table name > pluralization was turned off or whether I''ve missed a step it > disabling pluralization. I have not any documentation on this.Your change was for ActiveRecord table names only, It looks like from your stack trace that paginate is doing its own pluralizing. There''s no global "pluralization begone!" switch though. -- Rick Olson http://lighthouseapp.com http://weblog.techno-weenie.net http://mephistoblog.com --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Yes, I did. Thanks. On May 8, 12:28 pm, dasil003 <gabrie...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> You did restart the server/console after modifying environment.rb > right? > > On May 8, 11:52 am, Dave <dfdumar...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > I want to turn offtablenamepluralization, so I''ve added > > > ActiveRecord::Base.pluralize_table_names = false > > > at the end on my config/environment.rb > > > But I am getting an uninitialized constant error from paginator. > > > uninitialized constant Wherei > > > /usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/ > > dependencies.rb:266:in `load_missing_constant'' > > /usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/ > > dependencies.rb:452:in `const_missing'' > > /usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/ > > dependencies.rb:464:in `const_missing'' > > /usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/ > > inflector.rb:250:in `constantize'' > > /usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/ > > core_ext/string/inflections.rb:148:in `constantize'' > > /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/ > > pagination.rb:195:in `paginator_and_collection_for'' > > /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/ > > pagination.rb:130:in `paginate'' > > app/controllers/admin_controller.rb:12:in `list'' > > > Mytablenameis ''whereis'' and this seems to indicate that Rails is > > trying to get the modelnameby removing the plural from thetable > >name. > > > It would be helpful to know how to test whethertablename > > pluralization was turned off or whether I''ve missed a step it > > disabling pluralization. I have not any documentation on this. > > > Thanks > > Dave--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Good point! I''ve dumped the pagination. Thanks for the insight. Dave> Your change was for ActiveRecordtablenames only, It looks like from > your stack trace that paginate is doing its own pluralizing. There''s > no global "pluralization begone!" switch though. > > -- > Rick Olsonhttp://lighthouseapp.comhttp://weblog.techno-weenie.nethttp://mephistoblog.com--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---