Load Rails Rake tasks only once
In #39137, a new `Rake::Application` instance was created per Rake command invocation. To ensure that the Rails tasks were defined for each `Rake::Application`, `rails/tasks.rb` was loaded per instance. However, `Rake::Application#load_rakefile` loads the application's Rakefile, which should invoke `Rails.application.load_tasks`, which, in turn, also loads the Rails tasks. When a Rake task is defined more than once, all definition blocks are executed when the task is run. Hence, Rails task blocks were being executed twice. This commit removes the unnecessary load and avoids double execution. Fixes #40136.
Showing
想要评论请 注册 或 登录