aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport
diff options
context:
space:
mode:
authorKasper Timm Hansen <kaspth@gmail.com>2018-04-01 15:44:08 +0200
committerGitHub <noreply@github.com>2018-04-01 15:44:08 +0200
commit2c56d6324b224f3782c4da5e7ffae528293b09aa (patch)
tree9173f1bace145ab6188bf7ead324aef1133a83fc /activesupport
parent8d93107ba2554a9206a651ff2b96f2a87b061d14 (diff)
parent902b6e2bd039f55ddcf83a2c0bf4e794327e1105 (diff)
downloadrails-2c56d6324b224f3782c4da5e7ffae528293b09aa.tar.gz
rails-2c56d6324b224f3782c4da5e7ffae528293b09aa.tar.bz2
rails-2c56d6324b224f3782c4da5e7ffae528293b09aa.zip
Merge pull request #32268 from freeletics/encrypted-tmp-file-name
Change temporary file name extension while editing encrypted file.
Diffstat (limited to 'activesupport')
-rw-r--r--activesupport/lib/active_support/encrypted_file.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/encrypted_file.rb b/activesupport/lib/active_support/encrypted_file.rb
index 671b6b6a69..c66f1b557e 100644
--- a/activesupport/lib/active_support/encrypted_file.rb
+++ b/activesupport/lib/active_support/encrypted_file.rb
@@ -57,7 +57,7 @@ module ActiveSupport
private
def writing(contents)
- tmp_file = "#{content_path.basename}.#{Process.pid}"
+ tmp_file = "#{Process.pid}.#{content_path.basename.to_s.chomp('.enc')}"
tmp_path = Pathname.new File.join(Dir.tmpdir, tmp_file)
tmp_path.binwrite contents