-
Notifications
You must be signed in to change notification settings - Fork 22k
Move the initializers rake task to Rails::Command #33631
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
* Invoke Rails::Command within the rake task * Adds test for calling initializers with 'bin/rake' * Adds deprecation warning to the rake task
r? @eileencodes (@rails-bot has picked a reviewer for you, use r? to override) |
desc "Print out all defined initializers in the order they are invoked by Rails." | ||
task initializers: :environment do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I got rid of loading the environment here since we are loading it within the Rails::Command
. My assumption is that requiring it in both places would load it twice which is unnecessary, but please correct me if I'm wrong here .
The only down side of getting rid of it here is that our ActiveSupport::Deprecation.behavior
will not be taken into consideration and therefore the warning is outputted to stderr
instead of following whatever the user set up in their app. I thought it was pretty benign to have it output to stderr
since this entire task will be removed in 6.1 but please let me know if you feel strongly about keeping the environment loading here.
@@ -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." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please remove this desc
? It would remove this deprecated rake task from the task list(rake -T
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know we've removed documentation before from other things, but I don't think that's a helpful habit or the best approach.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kaspth if it's deprecated, and the command is now documented under rails
-proper, I don't see why we'd keep this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 to remove
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah yeah, that's right 👍
What this is doing:
initializers
rake task to use Rails::Command without changing the APIbin/rake
instead ofbin/rails
cc/ @kaspth