Skip to content

Commit

Permalink
Make the aggregate_reflections cache work with strings as its keys.
Browse files Browse the repository at this point in the history
  • Loading branch information
laurocaetano committed Apr 10, 2014
1 parent 4c6ba74 commit e7630b6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions activerecord/lib/active_record/reflection.rb
Expand Up @@ -26,7 +26,7 @@ def self.add_reflection(ar, name, reflection)
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
Expand All @@ -48,7 +48,7 @@ def reflect_on_all_aggregations
# 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
Expand Down

0 comments on commit e7630b6

Please sign in to comment.