aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/timestamp.rb
diff options
context:
space:
mode:
authorMatthew Draper <matthew@trebex.net>2017-07-09 03:07:08 +0930
committerGitHub <noreply@github.com>2017-07-09 03:07:08 +0930
commit5c17e34946457b9af428bcf955eb65493257dc3e (patch)
treebc76a1000911cf0e9ddb89d02bf129ab06101425 /activerecord/lib/active_record/timestamp.rb
parent1990c8f9b63aaa3b766c8ddf745f25cf8822b332 (diff)
parentdff37ff613d12201c2b770dbc61b125792c7bb6e (diff)
downloadrails-5c17e34946457b9af428bcf955eb65493257dc3e.tar.gz
rails-5c17e34946457b9af428bcf955eb65493257dc3e.tar.bz2
rails-5c17e34946457b9af428bcf955eb65493257dc3e.zip
Merge pull request #29495 from eugeneius/_write_attribute
Improve the performance of writing attributes
Diffstat (limited to 'activerecord/lib/active_record/timestamp.rb')
-rw-r--r--activerecord/lib/active_record/timestamp.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/timestamp.rb b/activerecord/lib/active_record/timestamp.rb
index dc4540eea6..26eea0bc24 100644
--- a/activerecord/lib/active_record/timestamp.rb
+++ b/activerecord/lib/active_record/timestamp.rb
@@ -86,7 +86,7 @@ module ActiveRecord
all_timestamp_attributes_in_model.each do |column|
if !attribute_present?(column)
- write_attribute(column, current_time)
+ _write_attribute(column, current_time)
end
end
end
@@ -100,7 +100,7 @@ module ActiveRecord
timestamp_attributes_for_update_in_model.each do |column|
next if will_save_change_to_attribute?(column)
- write_attribute(column, current_time)
+ _write_attribute(column, current_time)
end
end
super(*args)