Permalink
Browse files

#to_sym is unnecessary

  • Loading branch information...
1 parent 4bd9482 commit 780e8939c0f76399c76b13539f1ffe2d0940d941 @jonleighton jonleighton committed May 2, 2012
Showing with 3 additions and 3 deletions.
  1. +3 −3 activerecord/lib/active_record/dynamic_matchers.rb
View
6 activerecord/lib/active_record/dynamic_matchers.rb
@@ -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

0 comments on commit 780e893

Please sign in to comment.