aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails/application/railties.rb
diff options
context:
space:
mode:
Diffstat (limited to 'railties/lib/rails/application/railties.rb')
-rw-r--r--railties/lib/rails/application/railties.rb26
1 files changed, 8 insertions, 18 deletions
diff --git a/railties/lib/rails/application/railties.rb b/railties/lib/rails/application/railties.rb
index b3e6693f89..c1d2de571f 100644
--- a/railties/lib/rails/application/railties.rb
+++ b/railties/lib/rails/application/railties.rb
@@ -1,31 +1,21 @@
-module Rails
- class Application
- class Railties
- # TODO Write tests for this behavior extracted from Application
- def initialize(config)
- @config = config
- end
+require 'rails/engine/railties'
+module Rails
+ class Application < Engine
+ class Railties < Rails::Engine::Railties
def all(&block)
- @all ||= railties + engines + plugins
+ @all ||= railties + engines + super
@all.each(&block) if block
@all
end
def railties
- @railties ||= ::Rails::Railtie.subclasses.map(&:new)
+ @railties ||= ::Rails::Railtie.subclasses.map(&:instance)
end
def engines
- @engines ||= ::Rails::Engine.subclasses.map(&:new)
- end
-
- def plugins
- @plugins ||= begin
- plugin_names = (@config.plugins || [:all]).map { |p| p.to_sym }
- Plugin.all(plugin_names, @config.paths.vendor.plugins)
- end
+ @engines ||= ::Rails::Engine.subclasses.map(&:instance)
end
end
end
-end \ No newline at end of file
+end