Skip to content
This repository
Browse code

Make Rake::DSL methods available within Railtie rake_tasks block

Fixes incompatibility introduced by Rake 0.9.0
  • Loading branch information...
commit 83f257fc4862642af29056cb5b7dfef6e1303754 1 parent a37ae63
Patrick Quinn authored May 20, 2011 tenderlove committed May 23, 2011
10  railties/lib/rails/application.rb
@@ -211,10 +211,12 @@ def default_middleware_stack
211 211
     end
212 212
 
213 213
     def initialize_tasks
214  
-      require "rails/tasks"
215  
-      task :environment do
216  
-        $rails_rake_task = true
217  
-        require_environment!
  214
+      self.class.rake_tasks do
  215
+        require "rails/tasks"
  216
+        task :environment do
  217
+          $rails_rake_task = true
  218
+          require_environment!
  219
+        end
218 220
       end
219 221
     end
220 222
 
1  railties/lib/rails/railtie.rb
@@ -181,6 +181,7 @@ def load_console
181 181
     end
182 182
 
183 183
     def load_tasks
  184
+      extend Rake::DSL if defined? Rake::DSL
184 185
       self.class.rake_tasks.each(&:call)
185 186
     end
186 187
 

1 note on commit 83f257f

Erik Michaels-Ober
sferik commented on 83f257f May 25, 2011

:+1: Nice one! Congratulations on your first commit in Rails.

Please sign in to comment.
Something went wrong with that request. Please try again.