Just switched an app over from 1.2 to 2.0.
In accordance with the new convention, I moved my custom configuration
information out of config/environment.rb and into config/initializers/
app_config.rb. I found that my actionmailer config block was causing
an infinite loop (encompassing more than just the block itself).
Nothing like this happened with 1.2.x. Here's the code (nothing
special):
As is, Rails won't load and a never ending train of warnings about an
already initialized constant DOMAIN_NAME shows in the console
(evidence that the infinite loop encompasses more than the block). lib/
smtp_tls.rb is not the source of the problem and neither is the
declaration of the constant.
There are two ways to fix this as far as I know - comment out the
block and skip the configuration or put 'break' before 'end'.
Just switched an app over from 1.2 to 2.0.
In accordance with the new convention, I moved my custom configuration
information out of config/environment.rb and into config/initializers/
app_config.rb. I found that my actionmailer config block was causing
an infinite loop (encompassing more than just the block itself).
Nothing like this happened with 1.2.x. Here's the code (nothing
special):
Thanks Fred, that makes perfect sense. That being the case, how would
I inject this configuration information into the mix then?
I think that sort of stuff is fine to stay in environment.rb -
basically it's not about
extracting stuff from the Rails::Initializer.run do |config| block but
about all the stuff at the bottom.