diff options
author | José Valim <jose.valim@gmail.com> | 2010-03-23 23:50:24 +0100 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-03-23 23:50:53 +0100 |
commit | 5c41cb77d9af28fe6495d5c4047483ce3ceadfe6 (patch) | |
tree | cc9ab8088b2d3b05d372db80bb77d79c8f52b32e /railties/lib/rails/engine.rb | |
parent | cc0e402aa870fa710d6b6189dc090244b4462308 (diff) | |
download | rails-5c41cb77d9af28fe6495d5c4047483ce3ceadfe6.tar.gz rails-5c41cb77d9af28fe6495d5c4047483ce3ceadfe6.tar.bz2 rails-5c41cb77d9af28fe6495d5c4047483ce3ceadfe6.zip |
Ensure lib/rails/initializers/*.rb also works for gems.
Diffstat (limited to 'railties/lib/rails/engine.rb')
-rw-r--r-- | railties/lib/rails/engine.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/railties/lib/rails/engine.rb b/railties/lib/rails/engine.rb index 85b4ff8470..987573ea03 100644 --- a/railties/lib/rails/engine.rb +++ b/railties/lib/rails/engine.rb @@ -109,6 +109,13 @@ module Rails config.generators.templates.unshift(*paths.lib.templates.to_a) end + initializer :load_lib_initializers do |app| + paths.lib.rails.initializers.to_a.sort.each do |initializer| + config = app.config + eval(File.read(initializer), binding, initializer) + end + end + initializer :load_application_initializers do paths.config.initializers.to_a.sort.each do |initializer| load(initializer) |