aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/core_ext
diff options
context:
space:
mode:
authorRafael França <rafaelmfranca@gmail.com>2018-11-22 15:47:19 -0500
committerGitHub <noreply@github.com>2018-11-22 15:47:19 -0500
commit548bd509857ca5bba300915aa5ad9bff6e8c0238 (patch)
tree0411fe305a705172df1d2b19044d30a0a301f5e2 /activesupport/lib/active_support/core_ext
parent1b68ead8f8cb0d7a1771ab82ab20bd79857b40ee (diff)
parentc08272ac2469e6982f81d4e61cecae46f89fed7b (diff)
downloadrails-548bd509857ca5bba300915aa5ad9bff6e8c0238.tar.gz
rails-548bd509857ca5bba300915aa5ad9bff6e8c0238.tar.bz2
rails-548bd509857ca5bba300915aa5ad9bff6e8c0238.zip
Merge pull request #34037 from reitermarkus/atomic_write-permissions
`atomic_write`: Ensure correct permission when `tmpdir` is the same as `dirname`.
Diffstat (limited to 'activesupport/lib/active_support/core_ext')
-rw-r--r--activesupport/lib/active_support/core_ext/file/atomic.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/core_ext/file/atomic.rb b/activesupport/lib/active_support/core_ext/file/atomic.rb
index 8e288833b6..9deceb1bb4 100644
--- a/activesupport/lib/active_support/core_ext/file/atomic.rb
+++ b/activesupport/lib/active_support/core_ext/file/atomic.rb
@@ -29,7 +29,7 @@ class File
old_stat = if exist?(file_name)
# Get original file permissions
stat(file_name)
- elsif temp_dir != dirname(file_name)
+ else
# If not possible, probe which are the default permissions in the
# destination directory.
probe_stat_in(dirname(file_name))