Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Make the reflections cache work with strings as its keys.

  • Loading branch information...
commit 1f31488499111fdfce79d8dc1cc8fb008f7cdb25 1 parent c7d009b
@laurocaetano laurocaetano authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 activerecord/lib/active_record/reflection.rb
View
4 activerecord/lib/active_record/reflection.rb
@@ -22,7 +22,7 @@ def self.create(macro, name, scope, options, ar)
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 @@ def reflect_on_all_associations(macro = nil)
# 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.

1 comment on commit 1f31488

Please sign in to comment.
Something went wrong with that request. Please try again.