hideaki
2009-Apr-13 07:36 UTC
recognition_conditions called before overridden from environment.rb
Hi! I just updated rails 2.0.2 to 2.2.2 and noticed that my overriding ActionController::Routing::Route#recognition_conditions does not work as expected anymore. I was overriding the method from environment.rb, but I found that the method is called before my overriding takes place. So, it is executed without my customization... Does anyone have any remedy for that? Thank you, -Hideaki Hayashi --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Frederick Cheung
2009-Apr-13 08:40 UTC
Re: recognition_conditions called before overridden from environment.rb
On Apr 13, 8:36 am, hideaki <hihay...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi! > I just updated rails 2.0.2 to 2.2.2 and noticed that my overriding > ActionController::Routing::Route#recognition_conditions does not work > as expected anymore. > I was overriding the method from environment.rb, but I found that the > method is called before > my overriding takes place. So, it is executed without my > customization... > Does anyone have any remedy for that?As of rails 2.2, a bunch of stuff is loaded during startup (rather than on demand in production (because loading it on demand isn''t thread safe). As a general rule, things that you could keep at the bottom of environment.rb should now be in initializers (see http://www.spacevatican.org/2008/11/21/environment-rb-and-requiring-dependencies) Fred> Thank you, > -Hideaki Hayashi--~--~---------~--~----~------------~-------~--~----~ 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---