diff options
-rw-r--r-- | railties/lib/rails/application.rb | 10 | ||||
-rw-r--r-- | railties/lib/rails/railtie.rb | 1 |
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 |