Permalink
Browse files

Merge pull request #1174 from bilts/fix-rake-dsl

Make Rake::DSL methods available within Railtie rake_tasks block (so we're compatible with Rake 0.9.0).
  • Loading branch information...
2 parents da8469f + e290835 commit 8b719cf3f73cbce78506e3a42ed01b2c4314a70a @dhh dhh committed May 21, 2011
Showing with 7 additions and 4 deletions.
  1. +6 −4 railties/lib/rails/application.rb
  2. +1 −0 railties/lib/rails/railtie.rb
@@ -185,10 +185,12 @@ def default_middleware_stack
end
def initialize_tasks
- require "rails/tasks"
- task :environment do
- $rails_rake_task = true
- require_environment!
+ self.class.rake_tasks do
+ require "rails/tasks"
+ task :environment do
+ $rails_rake_task = true
+ require_environment!
+ end
end
end
@@ -178,6 +178,7 @@ def load_console(sandbox=false)
end
def load_tasks
+ extend Rake::DSL if defined? Rake::DSL
self.class.rake_tasks.each(&:call)
# load also tasks from all superclasses

0 comments on commit 8b719cf

Please sign in to comment.