Load Gitorious configuration during initialization phase of app booting
authorMarcin Kulik <m@ku1ik.com>
Fri, 13 Dec 2013 15:52:02 +0000 (16:52 +0100)
committerMarcin Kulik <m@ku1ik.com>
Fri, 13 Dec 2013 15:52:02 +0000 (16:52 +0100)
commita78fbb301d7719f56fe2df7009422502fbd1c491
treec62e6c537525c62c20451462aa1d6cbdd783e1f7
parent5c9328111f71e4f79c98ea6e94d8130b3ff5957d
Load Gitorious configuration during initialization phase of app booting

Previously, the configuration was loaded/initialized in application.rb
file. It was put there so it loads *before* all other initializers that
may need the configuration object. However, Rails loads application.rb
file also when you run `rake -T` or `rake assets:precompile` (even with
initialize_on_precompile = false) thus also loading the configuration.
Configuration loading is a part of initialization so it should not
happen when the app doesn't actually initialize.

This change ensures that the configuration is always loaded before all
other initializers (by having the name prefixed with underscore) but
never unnecessary loaded when the app isn't really initializing.
config/application.rb
config/initializers/_load_configuration.rb [new file with mode: 0644]