@@ -24,13 +24,13 @@ def edit
24
24
25
25
ensure_editor_available ( command : "bin/rails credentials:edit" ) || ( return )
26
26
27
- encrypted = Rails . application . encrypted ( content_path , key_path : key_path , env_key : env_key )
27
+ encrypted = Rails . application . encrypted ( content_path , key_path : key_path )
28
28
29
29
ensure_encryption_key_has_been_added ( key_path ) if encrypted . key . nil?
30
30
ensure_encrypted_file_has_been_added ( content_path , key_path )
31
31
32
32
catch_editing_exceptions do
33
- change_encrypted_file_in_system_editor ( content_path , key_path , env_key )
33
+ change_encrypted_file_in_system_editor ( content_path , key_path )
34
34
end
35
35
36
36
say "File encrypted and saved."
@@ -41,7 +41,7 @@ def edit
41
41
def show
42
42
require_application_and_environment!
43
43
44
- encrypted = Rails . application . encrypted ( content_path , key_path : key_path , env_key : env_key )
44
+ encrypted = Rails . application . encrypted ( content_path , key_path : key_path )
45
45
46
46
say encrypted . read . presence || missing_encrypted_message ( key : encrypted . key , key_path : key_path , file_path : content_path )
47
47
end
@@ -55,10 +55,6 @@ def key_path
55
55
options [ :environment ] ? "config/credentials/#{ options [ :environment ] } .key" : "config/master.key"
56
56
end
57
57
58
- def env_key
59
- options [ :environment ] ? "RAILS_#{ options [ :environment ] . upcase } _KEY" : "RAILS_MASTER_KEY"
60
- end
61
-
62
58
63
59
def ensure_encryption_key_has_been_added ( key_path )
64
60
encryption_key_file_generator . add_key_file ( key_path )
@@ -69,8 +65,8 @@ def ensure_encrypted_file_has_been_added(file_path, key_path)
69
65
encrypted_file_generator . add_encrypted_file_silently ( file_path , key_path )
70
66
end
71
67
72
- def change_encrypted_file_in_system_editor ( file_path , key_path , env_key )
73
- Rails . application . encrypted ( file_path , key_path : key_path , env_key : env_key ) . change do |tmp_path |
68
+ def change_encrypted_file_in_system_editor ( file_path , key_path )
69
+ Rails . application . encrypted ( file_path , key_path : key_path ) . change do |tmp_path |
74
70
system ( "#{ ENV [ "EDITOR" ] } #{ tmp_path } " )
75
71
end
76
72
end
0 commit comments