diff options
author | Piotr Sarnacki <drogus@gmail.com> | 2010-10-09 20:11:36 +0200 |
---|---|---|
committer | Piotr Sarnacki <drogus@gmail.com> | 2010-10-09 21:32:34 +0200 |
commit | b417cfbf01a17be7216d09e447f37bf1c19e4cb2 (patch) | |
tree | 7f1fb1f1919d927c0edd473dd99a9cd994bf0e18 /railties/lib | |
parent | 8636f64defb4b6fd9f00c70ffc9dc7ffc017fe58 (diff) | |
download | rails-b417cfbf01a17be7216d09e447f37bf1c19e4cb2.tar.gz rails-b417cfbf01a17be7216d09e447f37bf1c19e4cb2.tar.bz2 rails-b417cfbf01a17be7216d09e447f37bf1c19e4cb2.zip |
Load rake tasks defined in superclasses in context of railties
Diffstat (limited to 'railties/lib')
-rw-r--r-- | railties/lib/rails/railtie.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/railties/lib/rails/railtie.rb b/railties/lib/rails/railtie.rb index 2b68a3c453..c76bc83377 100644 --- a/railties/lib/rails/railtie.rb +++ b/railties/lib/rails/railtie.rb @@ -191,6 +191,13 @@ module Rails def load_tasks self.class.rake_tasks.each(&:call) + + # load also tasks from all superclasses + klass = self.class.superclass + while klass.respond_to?(:rake_tasks) + klass.rake_tasks.each { |t| self.instance_exec(&t) } + klass = klass.superclass + end end def load_generators |