diff options
author | Piotr Sarnacki <drogus@gmail.com> | 2010-06-23 23:02:02 +0200 |
---|---|---|
committer | Piotr Sarnacki <drogus@gmail.com> | 2010-09-03 22:59:03 +0200 |
commit | 675f3ead4193529de225cbb15dad3f9ed418f456 (patch) | |
tree | 2ceeb49b3c3604cb5043fc4a32a6cc5f7beaa88c /railties | |
parent | c787bfdf932450c5fd4c0df805454aa40a388117 (diff) | |
download | rails-675f3ead4193529de225cbb15dad3f9ed418f456.tar.gz rails-675f3ead4193529de225cbb15dad3f9ed418f456.tar.bz2 rails-675f3ead4193529de225cbb15dad3f9ed418f456.zip |
Gather initializers from railties in engines to get rid of additional looping through initializers
Diffstat (limited to 'railties')
-rw-r--r-- | railties/lib/rails/application/railties.rb | 10 | ||||
-rw-r--r-- | railties/lib/rails/engine.rb | 7 |
2 files changed, 7 insertions, 10 deletions
diff --git a/railties/lib/rails/application/railties.rb b/railties/lib/rails/application/railties.rb index 2b3783e998..67352f537e 100644 --- a/railties/lib/rails/application/railties.rb +++ b/railties/lib/rails/application/railties.rb @@ -16,16 +16,6 @@ module Rails def engines @engines ||= ::Rails::Engine.subclasses.map(&:instance) end - - def plugins - @plugins ||= super + plugins_for_engines - end - - def plugins_for_engines - engines.map { |e| - e.railties.plugins - }.flatten - end end end end diff --git a/railties/lib/rails/engine.rb b/railties/lib/rails/engine.rb index 385e3439f1..12ca553a24 100644 --- a/railties/lib/rails/engine.rb +++ b/railties/lib/rails/engine.rb @@ -158,6 +158,13 @@ module Rails app.call(env) end + def initializers + initializers = [] + railties.all { |r| initializers += r.initializers } + initializers += super + initializers + end + # Add configured load paths to ruby load paths and remove duplicates. initializer :set_load_path, :before => :bootstrap_hook do _all_load_paths.reverse_each do |path| |