aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails
diff options
context:
space:
mode:
Diffstat (limited to 'railties/lib/rails')
-rw-r--r--railties/lib/rails/secrets.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/railties/lib/rails/secrets.rb b/railties/lib/rails/secrets.rb
index 955ab096e8..46e21185d7 100644
--- a/railties/lib/rails/secrets.rb
+++ b/railties/lib/rails/secrets.rb
@@ -101,11 +101,11 @@ module Rails
def writing(contents)
tmp_path = File.join(Dir.tmpdir, File.basename(path))
- File.write(tmp_path, contents)
+ IO.binwrite(tmp_path, contents)
yield tmp_path
- updated_contents = File.read(tmp_path)
+ updated_contents = IO.binread(tmp_path)
write(updated_contents) if updated_contents != contents
ensure