Make Rake::DSL methods available within Railtie rake_tasks block

Fixes incompatibility introduced by Rake 0.9.0
This commit is contained in:
Patrick Quinn 2011-05-20 20:02:20 -04:00
parent 5eadb4d73d
commit e290835667
2 changed files with 7 additions and 4 deletions

View File

@ -185,10 +185,12 @@ module Rails
end end
def initialize_tasks def initialize_tasks
require "rails/tasks" self.class.rake_tasks do
task :environment do require "rails/tasks"
$rails_rake_task = true task :environment do
require_environment! $rails_rake_task = true
require_environment!
end
end end
end end

View File

@ -178,6 +178,7 @@ module Rails
end end
def load_tasks def load_tasks
extend Rake::DSL if defined? Rake::DSL
self.class.rake_tasks.each(&:call) self.class.rake_tasks.each(&:call)
# load also tasks from all superclasses # load also tasks from all superclasses