Skip to content

Commit

Permalink
#to_sym is unnecessary
Browse files Browse the repository at this point in the history
  • Loading branch information
jonleighton committed May 4, 2012
1 parent 4bd9482 commit 780e893
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions activerecord/lib/active_record/dynamic_matchers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,15 @@ def initialize(model, name)
def expand_attribute_names_for_aggregates
attribute_names.map do |attribute_name|
if aggregation = model.reflect_on_aggregation(attribute_name.to_sym)
aggregation.mapping.map { |m| m.first.to_sym }
aggregation.mapping.map(&:first)
else
attribute_name.to_sym
attribute_name
end
end.flatten
end

def valid?
(expand_attribute_names_for_aggregates - model.column_methods_hash.keys).empty?
(expand_attribute_names_for_aggregates - model.column_names).empty?
end

def define
Expand Down

0 comments on commit 780e893

Please sign in to comment.