aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails/tasks
diff options
context:
space:
mode:
authorAnnie-Claude Côté <hello@annie.codes>2018-08-16 10:50:37 -0400
committerAnnie-Claude Côté <hello@annie.codes>2018-08-16 10:50:37 -0400
commit0d3b5fc0f5e1a208d0666985f68ed6418ba7e8b4 (patch)
treeb67e111058cf2a9c01f2fdec9bc2aad523df4b0c /railties/lib/rails/tasks
parent1ce2f9a55c21873f334e0c3cbc70e1b56f442442 (diff)
downloadrails-0d3b5fc0f5e1a208d0666985f68ed6418ba7e8b4.tar.gz
rails-0d3b5fc0f5e1a208d0666985f68ed6418ba7e8b4.tar.bz2
rails-0d3b5fc0f5e1a208d0666985f68ed6418ba7e8b4.zip
Update 'rake initializers' to use Rails::Command under the hood
* Invoke Rails::Command within the rake task * Adds test for calling initializers with 'bin/rake' * Adds deprecation warning to the rake task
Diffstat (limited to 'railties/lib/rails/tasks')
-rw-r--r--railties/lib/rails/tasks/initializers.rake10
1 files changed, 6 insertions, 4 deletions
diff --git a/railties/lib/rails/tasks/initializers.rake b/railties/lib/rails/tasks/initializers.rake
index ae85cb0f86..7ccf7455bb 100644
--- a/railties/lib/rails/tasks/initializers.rake
+++ b/railties/lib/rails/tasks/initializers.rake
@@ -1,8 +1,10 @@
# frozen_string_literal: true
+require "rails/command"
+require "active_support/deprecation"
+
desc "Print out all defined initializers in the order they are invoked by Rails."
-task initializers: :environment do
- Rails.application.initializers.tsort_each do |initializer|
- puts "#{initializer.context_class}.#{initializer.name}"
- end
+task :initializers do
+ ActiveSupport::Deprecation.warn("Using `bin/rake initializers` is deprecated and will be removed in Rails 6.1. Use `bin/rails initializers` instead.\n")
+ Rails::Command.invoke "initializers"
end