aboutsummaryrefslogtreecommitdiffstats
path: root/railties
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2011-06-16 11:03:58 -0700
committerJosé Valim <jose.valim@gmail.com>2011-06-16 11:03:58 -0700
commitb9fa32c75e4ac6986c22880085657f44972124a4 (patch)
tree74416ee168008ed5073ecd1d8c047144007aff6b /railties
parent885428887fff1c1993087065a2693439ab01f2d1 (diff)
parent245dba0c8941463e4b07733443bb0e161889b153 (diff)
downloadrails-b9fa32c75e4ac6986c22880085657f44972124a4.tar.gz
rails-b9fa32c75e4ac6986c22880085657f44972124a4.tar.bz2
rails-b9fa32c75e4ac6986c22880085657f44972124a4.zip
Merge pull request #1733 from SAP-Oxygen/master-plugins_in_engine_patch
Cherry-picking patch for https://github.com/rails/rails/issues/1460 from 3-1-stable to master
Diffstat (limited to 'railties')
-rw-r--r--railties/lib/rails/application.rb6
-rw-r--r--railties/lib/rails/engine.rb12
2 files changed, 10 insertions, 8 deletions
diff --git a/railties/lib/rails/application.rb b/railties/lib/rails/application.rb
index a2b2af98a6..fe29668c72 100644
--- a/railties/lib/rails/application.rb
+++ b/railties/lib/rails/application.rb
@@ -78,10 +78,6 @@ module Rails
require environment if environment
end
- def eager_load! #:nodoc:
- railties.all(&:eager_load!)
- super
- end
def reload_routes!
routes_reloader.reload!
@@ -100,14 +96,12 @@ module Rails
def load_tasks(app=self)
initialize_tasks
- railties.all { |r| r.load_tasks(app) }
super
self
end
def load_console(app=self)
initialize_console
- railties.all { |r| r.load_console(app) }
super
self
end
diff --git a/railties/lib/rails/engine.rb b/railties/lib/rails/engine.rb
index b358de89d0..52c89274e7 100644
--- a/railties/lib/rails/engine.rb
+++ b/railties/lib/rails/engine.rb
@@ -395,12 +395,20 @@ module Rails
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_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|