Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Gather initializers from railties in engines to get rid of additional…

… looping through initializers
  • Loading branch information...
commit 675f3ead4193529de225cbb15dad3f9ed418f456 1 parent c787bfd
Piotr Sarnacki drogus authored
10 railties/lib/rails/application/railties.rb
View
@@ -16,16 +16,6 @@ def railties
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
7 railties/lib/rails/engine.rb
View
@@ -158,6 +158,13 @@ def call(env)
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|
Please sign in to comment.
Something went wrong with that request. Please try again.