Forum: Ruby on Rails recognition_conditions called before overridden from environment.rb

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
hideaki (Guest)
on 2009-04-13 12:37
(Received via mailing list)
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
Frederick C. (Guest)
on 2009-04-13 12:41
(Received via mailing list)
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...)

Fred
This topic is locked and can not be replied to.