aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib
diff options
context:
space:
mode:
authorYves Senn <yves.senn@gmail.com>2013-11-26 07:16:17 -0800
committerYves Senn <yves.senn@gmail.com>2013-11-26 07:16:17 -0800
commitd35678242cbb45f19039e3da6ba13911951b1f9b (patch)
tree0e8a9680d7783324ba2e4020edfa943c921c48e9 /activerecord/lib
parent3669704050edfeb125d79a838d18584ec4a51a1a (diff)
parent45d4d141f971e50e2df40bbf3559ee254ebc81b9 (diff)
downloadrails-d35678242cbb45f19039e3da6ba13911951b1f9b.tar.gz
rails-d35678242cbb45f19039e3da6ba13911951b1f9b.tar.bz2
rails-d35678242cbb45f19039e3da6ba13911951b1f9b.zip
Merge pull request #13018 from heruku/scoping_fix
changed update counter to act on unscoped model
Diffstat (limited to 'activerecord/lib')
-rw-r--r--activerecord/lib/active_record/counter_cache.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/counter_cache.rb b/activerecord/lib/active_record/counter_cache.rb
index 3aa5faed87..7e3bef9431 100644
--- a/activerecord/lib/active_record/counter_cache.rb
+++ b/activerecord/lib/active_record/counter_cache.rb
@@ -77,7 +77,7 @@ module ActiveRecord
"#{quoted_column} = COALESCE(#{quoted_column}, 0) #{operator} #{value.abs}"
end
- where(primary_key => id).update_all updates.join(', ')
+ unscoped.where(primary_key => id).update_all updates.join(', ')
end
# Increment a numeric field by one, via a direct SQL update.