diff options
author | Rafael França <rafaelmfranca@gmail.com> | 2017-01-01 17:47:32 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-01-01 17:47:32 -0500 |
commit | e7b84e7081631b13cc9a6f436e6cead335a78f28 (patch) | |
tree | a7a3830451daccf8816d17c72b98dc4b2bd261ae | |
parent | 3e8fa248b194c221e931d646d3eceb59990e90eb (diff) | |
parent | a8b44e4f4e06b5fdd89077c82586066d2e3b7830 (diff) | |
download | rails-e7b84e7081631b13cc9a6f436e6cead335a78f28.tar.gz rails-e7b84e7081631b13cc9a6f436e6cead335a78f28.tar.bz2 rails-e7b84e7081631b13cc9a6f436e6cead335a78f28.zip |
Merge pull request #27540 from kamipo/touch_time_should_be_type_casted
`touch_time` should be type casted to respect the precision of the column
-rw-r--r-- | activerecord/lib/active_record/counter_cache.rb | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/activerecord/lib/active_record/counter_cache.rb b/activerecord/lib/active_record/counter_cache.rb index 020f4b872e..a0ef430683 100644 --- a/activerecord/lib/active_record/counter_cache.rb +++ b/activerecord/lib/active_record/counter_cache.rb @@ -106,9 +106,7 @@ module ActiveRecord if touch object = find(id) - touch_updates(object, touch).each do |column, touch_time| - updates << "#{connection.quote_column_name(column.to_s)} = #{connection.quote(touch_time)}" - end + updates << object.class.send(:sanitize_sql_for_assignment, touch_updates(object, touch)) end unscoped.where(primary_key => id).update_all updates.join(", ") |