aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails/commands/credentials
diff options
context:
space:
mode:
Diffstat (limited to 'railties/lib/rails/commands/credentials')
-rw-r--r--railties/lib/rails/commands/credentials/USAGE2
-rw-r--r--railties/lib/rails/commands/credentials/credentials_command.rb6
2 files changed, 4 insertions, 4 deletions
diff --git a/railties/lib/rails/commands/credentials/USAGE b/railties/lib/rails/commands/credentials/USAGE
index 85877c71b7..ea429f58d8 100644
--- a/railties/lib/rails/commands/credentials/USAGE
+++ b/railties/lib/rails/commands/credentials/USAGE
@@ -14,7 +14,7 @@ that just contains the secret_key_base used by MessageVerifiers/MessageEncryptor
signing and encrypting cookies.
For applications created prior to Rails 5.2, we'll automatically generate a new
-credentials file in `config/credentials.yml.enc` the first time you run `bin/rails credentials:edit`.
+credentials file in `config/credentials.yml.enc` the first time you run `rails credentials:edit`.
If you didn't have a master key saved in `config/master.key`, that'll be created too.
Don't lose this master key! Put it in a password manager your team can access.
diff --git a/railties/lib/rails/commands/credentials/credentials_command.rb b/railties/lib/rails/commands/credentials/credentials_command.rb
index 385d3976da..65c5218fc8 100644
--- a/railties/lib/rails/commands/credentials/credentials_command.rb
+++ b/railties/lib/rails/commands/credentials/credentials_command.rb
@@ -20,7 +20,7 @@ module Rails
require_application_and_environment!
ensure_editor_available(command: "bin/rails credentials:edit") || (return)
- ensure_master_key_has_been_added
+ ensure_master_key_has_been_added if Rails.application.credentials.key.nil?
ensure_credentials_have_been_added
catch_editing_exceptions do
@@ -69,9 +69,9 @@ module Rails
def missing_credentials_message
if Rails.application.credentials.key.nil?
- "Missing master key to decrypt credentials. See bin/rails credentials:help"
+ "Missing master key to decrypt credentials. See `rails credentials:help`"
else
- "No credentials have been added yet. Use bin/rails credentials:edit to change that."
+ "No credentials have been added yet. Use `rails credentials:edit` to change that."
end
end
end