aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/persistence.rb
diff options
context:
space:
mode:
authorRyuta Kamizono <kamipo@gmail.com>2018-03-23 10:05:54 +0900
committerRyuta Kamizono <kamipo@gmail.com>2018-03-23 10:05:54 +0900
commit6aa5cf03ea8232180ffbbae4c130b051f813c670 (patch)
tree29f6062d0288857e267aaf22af157f6963912a68 /activerecord/lib/active_record/persistence.rb
parent57e145387ba57602afb0907f2a3897d37089dc4e (diff)
downloadrails-6aa5cf03ea8232180ffbbae4c130b051f813c670.tar.gz
rails-6aa5cf03ea8232180ffbbae4c130b051f813c670.tar.bz2
rails-6aa5cf03ea8232180ffbbae4c130b051f813c670.zip
Fix that `touch(:updated_at)` causes multiple assignments on the column
The multiple assignments was caused by 37a1dfa due to lost the `to_s` normalization for given names. Fixes #32323.
Diffstat (limited to 'activerecord/lib/active_record/persistence.rb')
-rw-r--r--activerecord/lib/active_record/persistence.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/persistence.rb b/activerecord/lib/active_record/persistence.rb
index 6ec477c7f3..7721e6b691 100644
--- a/activerecord/lib/active_record/persistence.rb
+++ b/activerecord/lib/active_record/persistence.rb
@@ -658,7 +658,7 @@ module ActiveRecord
end
attribute_names = timestamp_attributes_for_update_in_model
- attribute_names.concat(names)
+ attribute_names |= names.map(&:to_s)
unless attribute_names.empty?
affected_rows = _touch_row(attribute_names, time)