aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick Quinn <patrick@patrickquinn.net>2011-05-20 20:02:20 -0400
committerPatrick Quinn <patrick@patrickquinn.net>2011-05-20 22:58:05 -0400
commite2908356672d4459ada0064f773efd820efda822 (patch)
tree2b22b98d99bc44ea9829b30d37b504ae40f397f8
parent5eadb4d73dc5384509efeea3b9584ded19956c7b (diff)
downloadrails-e2908356672d4459ada0064f773efd820efda822.tar.gz
rails-e2908356672d4459ada0064f773efd820efda822.tar.bz2
rails-e2908356672d4459ada0064f773efd820efda822.zip
Make Rake::DSL methods available within Railtie rake_tasks block
Fixes incompatibility introduced by Rake 0.9.0
-rw-r--r--railties/lib/rails/application.rb10
-rw-r--r--railties/lib/rails/railtie.rb1
2 files changed, 7 insertions, 4 deletions
diff --git a/railties/lib/rails/application.rb b/railties/lib/rails/application.rb
index 816bff29b7..a7405aae16 100644
--- a/railties/lib/rails/application.rb
+++ b/railties/lib/rails/application.rb
@@ -185,10 +185,12 @@ module Rails
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
diff --git a/railties/lib/rails/railtie.rb b/railties/lib/rails/railtie.rb
index b183eb8ddd..0a65840c2b 100644
--- a/railties/lib/rails/railtie.rb
+++ b/railties/lib/rails/railtie.rb
@@ -178,6 +178,7 @@ module Rails
end
def load_tasks
+ extend Rake::DSL if defined? Rake::DSL
self.class.rake_tasks.each(&:call)
# load also tasks from all superclasses