aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails/commands/encrypted
diff options
context:
space:
mode:
authorYuji Yaginuma <yuuji.yaginuma@gmail.com>2018-02-08 19:49:50 +0900
committerGitHub <noreply@github.com>2018-02-08 19:49:50 +0900
commit5d75ef72e61f00bbf987aa5a73e9ca2a1e23d718 (patch)
tree9723c9838931817aefa7974d30e57e05c1ba5ca2 /railties/lib/rails/commands/encrypted
parentcc523fba9baf09849aeb59db28dab04135839f34 (diff)
downloadrails-5d75ef72e61f00bbf987aa5a73e9ca2a1e23d718.tar.gz
rails-5d75ef72e61f00bbf987aa5a73e9ca2a1e23d718.tar.bz2
rails-5d75ef72e61f00bbf987aa5a73e9ca2a1e23d718.zip
Do not add master key when `RAILS_MASTER_KEY` env specified (#31922)
Fixes #31917
Diffstat (limited to 'railties/lib/rails/commands/encrypted')
-rw-r--r--railties/lib/rails/commands/encrypted/encrypted_command.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/railties/lib/rails/commands/encrypted/encrypted_command.rb b/railties/lib/rails/commands/encrypted/encrypted_command.rb
index 912c453f09..3bc8f76ce4 100644
--- a/railties/lib/rails/commands/encrypted/encrypted_command.rb
+++ b/railties/lib/rails/commands/encrypted/encrypted_command.rb
@@ -21,9 +21,10 @@ module Rails
def edit(file_path)
require_application_and_environment!
+ encrypted = Rails.application.encrypted(file_path, key_path: options[:key])
ensure_editor_available(command: "bin/rails encrypted:edit") || (return)
- ensure_encryption_key_has_been_added(options[:key])
+ ensure_encryption_key_has_been_added(options[:key]) if encrypted.key.nil?
ensure_encrypted_file_has_been_added(file_path, options[:key])
catch_editing_exceptions do