Recognition_conditions called before overridden from environment.rb


#1

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


#2

On Apr 13, 8:36 am, hideaki removed_email_address@domain.invalid 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