aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/reflection.rb
diff options
context:
space:
mode:
authorLauro Caetano <laurocaetano1@gmail.com>2014-04-09 21:23:43 -0300
committerLauro Caetano <laurocaetano1@gmail.com>2014-04-09 21:23:43 -0300
commit1f31488499111fdfce79d8dc1cc8fb008f7cdb25 (patch)
tree19bac131e93ebed2183a31742796fba483662733 /activerecord/lib/active_record/reflection.rb
parentc7d009b35e2b6b35352eaeba6290b67e8afffdb1 (diff)
downloadrails-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/active_record/reflection.rb')
-rw-r--r--activerecord/lib/active_record/reflection.rb4
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.