aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/counter_cache.rb
diff options
context:
space:
mode:
authorGodfrey Chan <godfreykfc@gmail.com>2014-09-20 18:05:01 +0900
committerGodfrey Chan <godfreykfc@gmail.com>2014-09-20 18:05:01 +0900
commit1a2e3a0431651a44ab39e0881237c182770e29ed (patch)
tree3ad8b25fb2cf734fca96bd17395ca86931dd0614 /activerecord/lib/active_record/counter_cache.rb
parent90f99689121487328f022fd09841b62378423afe (diff)
downloadrails-1a2e3a0431651a44ab39e0881237c182770e29ed.tar.gz
rails-1a2e3a0431651a44ab39e0881237c182770e29ed.tar.bz2
rails-1a2e3a0431651a44ab39e0881237c182770e29ed.zip
No need to call to_sym here
The hash is now string-keyed, and [_]reflect_on_association calls `to_s` on the argument anyway.
Diffstat (limited to 'activerecord/lib/active_record/counter_cache.rb')
-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 f0b6afc4b4..73fd96f979 100644
--- a/activerecord/lib/active_record/counter_cache.rb
+++ b/activerecord/lib/active_record/counter_cache.rb
@@ -20,7 +20,7 @@ module ActiveRecord
def reset_counters(id, *counters)
object = find(id)
counters.each do |counter_association|
- has_many_association = _reflect_on_association(counter_association.to_sym)
+ has_many_association = _reflect_on_association(counter_association)
unless has_many_association
has_many = reflect_on_all_associations(:has_many)
has_many_association = has_many.find { |association| association.counter_cache_column && association.counter_cache_column.to_sym == counter_association.to_sym }