From 45d4d141f971e50e2df40bbf3559ee254ebc81b9 Mon Sep 17 00:00:00 2001 From: heruku Date: Sun, 24 Nov 2013 03:47:17 -0600 Subject: changed update counter to act on unscoped model --- activerecord/lib/active_record/counter_cache.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activerecord/lib/active_record') 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. -- cgit v1.2.3