1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Call a block passed rake_tasks method in the self context

This commit is contained in:
kennyj 2011-11-27 22:49:37 +09:00
parent 3c81fc3b91
commit 7f8f554d75

View file

@ -181,7 +181,7 @@ module Rails
def load_tasks(app=self) def load_tasks(app=self)
extend Rake::DSL if defined? Rake::DSL extend Rake::DSL if defined? Rake::DSL
self.class.rake_tasks.each { |block| block.call(app) } self.class.rake_tasks.each { |block| self.instance_exec(app, &block) }
# load also tasks from all superclasses # load also tasks from all superclasses
klass = self.class.superclass klass = self.class.superclass