diff options
author | Lauro Caetano <laurocaetano1@gmail.com> | 2014-04-09 21:23:43 -0300 |
---|---|---|
committer | Lauro Caetano <laurocaetano1@gmail.com> | 2014-04-09 21:23:43 -0300 |
commit | 1f31488499111fdfce79d8dc1cc8fb008f7cdb25 (patch) | |
tree | 19bac131e93ebed2183a31742796fba483662733 /activerecord/lib | |
parent | c7d009b35e2b6b35352eaeba6290b67e8afffdb1 (diff) | |
download | rails-1f31488499111fdfce79d8dc1cc8fb008f7cdb25.tar.gz rails-1f31488499111fdfce79d8dc1cc8fb008f7cdb25.tar.bz2 rails-1f31488499111fdfce79d8dc1cc8fb008f7cdb25.zip |
Make the 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 5465a7bfd7..9e4c70dabf 100644 --- a/activerecord/lib/active_record/reflection.rb +++ b/activerecord/lib/active_record/reflection.rb @@ -22,7 +22,7 @@ module ActiveRecord end def self.add_reflection(ar, name, reflection) - ar.reflections = ar.reflections.merge(name => reflection) + ar.reflections = ar.reflections.merge(name.to_s => reflection) end def self.add_aggregate_reflection(ar, name, reflection) @@ -72,7 +72,7 @@ module ActiveRecord # Invoice.reflect_on_association(:line_items).macro # returns :has_many # def reflect_on_association(association) - reflections[association] + reflections[association.to_s] end # Returns an array of AssociationReflection objects for all associations which have <tt>:autosave</tt> enabled. |