From 6aa5cf03ea8232180ffbbae4c130b051f813c670 Mon Sep 17 00:00:00 2001 From: Ryuta Kamizono Date: Fri, 23 Mar 2018 10:05:54 +0900 Subject: 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. --- activerecord/lib/active_record/persistence.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activerecord/lib/active_record') 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) -- cgit v1.2.3