diff options
author | Lauro Caetano <laurocaetano1@gmail.com> | 2014-04-09 21:34:48 -0300 |
---|---|---|
committer | Lauro Caetano <laurocaetano1@gmail.com> | 2014-04-09 21:34:48 -0300 |
commit | e7630b62a604a0bc11a56283140f11a80e4cc1b0 (patch) | |
tree | 7f880198af80a05a81824e4bd4462588861b9abd /activerecord/lib | |
parent | 4c6ba7432dc5288708817d5b03e7ed13458ca58d (diff) | |
download | rails-e7630b62a604a0bc11a56283140f11a80e4cc1b0.tar.gz rails-e7630b62a604a0bc11a56283140f11a80e4cc1b0.tar.bz2 rails-e7630b62a604a0bc11a56283140f11a80e4cc1b0.zip |
Make the aggregate_reflections cache work with strings as its keys.
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/reflection.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/reflection.rb b/activerecord/lib/active_record/reflection.rb index eddc0cf51c..1ce477f38b 100644 --- a/activerecord/lib/active_record/reflection.rb +++ b/activerecord/lib/active_record/reflection.rb @@ -26,7 +26,7 @@ module ActiveRecord end def self.add_aggregate_reflection(ar, name, reflection) - ar.aggregate_reflections = ar.aggregate_reflections.merge(name => reflection) + ar.aggregate_reflections = ar.aggregate_reflections.merge(name.to_s => reflection) end # \Reflection enables to interrogate Active Record classes and objects @@ -48,7 +48,7 @@ module ActiveRecord # Account.reflect_on_aggregation(:balance) # => the balance AggregateReflection # def reflect_on_aggregation(aggregation) - aggregate_reflections[aggregation] + aggregate_reflections[aggregation.to_s] end # Returns an array of AssociationReflection objects for all the |