aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib
diff options
context:
space:
mode:
authorWojciech Wnętrzak <w.wnetrzak@gmail.com>2018-03-16 13:00:02 +0100
committerWojciech Wnętrzak <w.wnetrzak@gmail.com>2018-03-18 21:29:41 +0100
commit902b6e2bd039f55ddcf83a2c0bf4e794327e1105 (patch)
treeb037ae316e788b08ec301db160bea8e0b32c2d5d /activesupport/lib
parent45ddb7f1f94c2086488aaaac47a1092cf832f381 (diff)
downloadrails-902b6e2bd039f55ddcf83a2c0bf4e794327e1105.tar.gz
rails-902b6e2bd039f55ddcf83a2c0bf4e794327e1105.tar.bz2
rails-902b6e2bd039f55ddcf83a2c0bf4e794327e1105.zip
Change temporary file name extension while editing encrypted file.
To have syntax highlighting in an editor try to preserve original extension of edited file.
Diffstat (limited to 'activesupport/lib')
-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