aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails/secrets.rb
diff options
context:
space:
mode:
Diffstat (limited to 'railties/lib/rails/secrets.rb')
-rw-r--r--railties/lib/rails/secrets.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/railties/lib/rails/secrets.rb b/railties/lib/rails/secrets.rb
index c7a8676d7b..955ab096e8 100644
--- a/railties/lib/rails/secrets.rb
+++ b/railties/lib/rails/secrets.rb
@@ -105,7 +105,9 @@ module Rails
yield tmp_path
- write(File.read(tmp_path))
+ updated_contents = File.read(tmp_path)
+
+ write(updated_contents) if updated_contents != contents
ensure
FileUtils.rm(tmp_path) if File.exist?(tmp_path)
end