Permalink
Browse files

Merge pull request #1460 from SAP-Oxygen/27d7083addd1bc8ecf0ef258a50c…

…5e36eb980060

[3.1.0.rc1] Plugins inside engines not eager-loaded properly and their rake tasks ignored
  • Loading branch information...
2 parents 014008d + 27d7083 commit 60a319040f96eb24667b939a0b9aee3a06a74f2c @josevalim josevalim committed Jun 16, 2011
Showing with 14 additions and 9 deletions.
  1. +0 −8 railties/lib/rails/application.rb
  2. +14 −1 railties/lib/rails/engine.rb
@@ -78,10 +78,6 @@ def require_environment! #:nodoc:
require environment if environment
end
- def eager_load! #:nodoc:
- railties.all(&:eager_load!)
- super
- end
def reload_routes!
routes_reloader.reload!
@@ -100,22 +96,18 @@ def initialize!
def load_tasks(app=self)
initialize_tasks
- railties.all { |r| r.load_tasks(app) }
super
self
end
def load_generators(app=self)
initialize_generators
- railties.all { |r| r.load_generators(app) }
-
super
self
end
def load_console(app=self)
initialize_console
- railties.all { |r| r.load_console(app) }
super
self
end
@@ -387,12 +387,25 @@ def find(path)
delegate :middleware, :root, :paths, :to => :config
delegate :engine_name, :isolated?, :to => "self.class"
- def load_tasks(*)
+ def load_tasks(app=self)
+ railties.all { |r| r.load_tasks(app) }
super
paths["lib/tasks"].existent.sort.each { |ext| load(ext) }
end
+
+ def load_generators(app=self)
+ railties.all { |r| r.load_generators(app) }
+ super
+ end
+ def load_console(app=self)
+ railties.all { |r| r.load_console(app) }
+ super
+ end
+
def eager_load!
+ railties.all(&:eager_load!)
+
config.eager_load_paths.each do |load_path|
matcher = /\A#{Regexp.escape(load_path)}\/(.*)\.rb\Z/
Dir.glob("#{load_path}/**/*.rb").sort.each do |file|

0 comments on commit 60a3190

Please sign in to comment.