Skip to content

Commit

Permalink
Make Rake::DSL methods available within Railtie rake_tasks block
Browse files Browse the repository at this point in the history
Fixes incompatibility introduced by Rake 0.9.0
  • Loading branch information
bilts authored and tenderlove committed May 23, 2011
1 parent a37ae63 commit 83f257f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
10 changes: 6 additions & 4 deletions railties/lib/rails/application.rb
Expand Up @@ -211,10 +211,12 @@ def default_middleware_stack
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


Expand Down
1 change: 1 addition & 0 deletions railties/lib/rails/railtie.rb
Expand Up @@ -181,6 +181,7 @@ def load_console
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)
end end


Expand Down

1 comment on commit 83f257f

@sferik
Copy link
Contributor

@sferik sferik commented on 83f257f May 26, 2011

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Nice one! Congratulations on your first commit in Rails.

Please sign in to comment.