aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/reflection.rb
diff options
context:
space:
mode:
authorJon Leighton <j@jonathanleighton.com>2011-09-06 15:58:07 +0100
committerJon Leighton <j@jonathanleighton.com>2011-09-06 15:58:07 +0100
commitb24d668859c5836c0e3ed277b2022a1a39eb3f8e (patch)
tree9ba6b20c7bb26165953748e4ff9a5305c550575d /activerecord/lib/active_record/reflection.rb
parent9f3e732e65dfa978e036a3b0df3578b2d6a6510a (diff)
downloadrails-b24d668859c5836c0e3ed277b2022a1a39eb3f8e.tar.gz
rails-b24d668859c5836c0e3ed277b2022a1a39eb3f8e.tar.bz2
rails-b24d668859c5836c0e3ed277b2022a1a39eb3f8e.zip
Ensure we are not comparing a string with a symbol in HasManyAssociation#inverse_updates_counter_cache?. Fixes #2755, where a counter cache could be decremented twice as far as it was supposed to be.
Diffstat (limited to 'activerecord/lib/active_record/reflection.rb')
-rw-r--r--activerecord/lib/active_record/reflection.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/reflection.rb b/activerecord/lib/active_record/reflection.rb
index a2324039cf..89179779e3 100644
--- a/activerecord/lib/active_record/reflection.rb
+++ b/activerecord/lib/active_record/reflection.rb
@@ -226,7 +226,7 @@ module ActiveRecord
if options[:counter_cache] == true
"#{active_record.name.demodulize.underscore.pluralize}_count"
elsif options[:counter_cache]
- options[:counter_cache]
+ options[:counter_cache].to_s
end
end