diff options
author | José Valim <jose.valim@gmail.com> | 2011-06-16 11:03:58 -0700 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2011-06-16 11:03:58 -0700 |
commit | b9fa32c75e4ac6986c22880085657f44972124a4 (patch) | |
tree | 74416ee168008ed5073ecd1d8c047144007aff6b /railties/lib/rails/engine.rb | |
parent | 885428887fff1c1993087065a2693439ab01f2d1 (diff) | |
parent | 245dba0c8941463e4b07733443bb0e161889b153 (diff) | |
download | rails-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/lib/rails/engine.rb')
-rw-r--r-- | railties/lib/rails/engine.rb | 12 |
1 files changed, 10 insertions, 2 deletions
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| |