diff options
Diffstat (limited to 'activerecord/lib/active_record/dynamic_matchers.rb')
-rw-r--r-- | activerecord/lib/active_record/dynamic_matchers.rb | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/activerecord/lib/active_record/dynamic_matchers.rb b/activerecord/lib/active_record/dynamic_matchers.rb index f3f143940f..96a3a69d0d 100644 --- a/activerecord/lib/active_record/dynamic_matchers.rb +++ b/activerecord/lib/active_record/dynamic_matchers.rb @@ -63,9 +63,7 @@ module ActiveRecord def expand_attribute_names_for_aggregates attribute_names.map do |attribute_name| if aggregation = model.reflect_on_aggregation(attribute_name.to_sym) - model.send(:aggregate_mapping, aggregation).map do |field_attr, _| - field_attr.to_sym - end + aggregation.mapping.map { |m| m.first.to_sym } else attribute_name.to_sym end @@ -240,10 +238,5 @@ module ActiveRecord "create!" end end - - def aggregate_mapping(reflection) - mapping = reflection.options[:mapping] || [reflection.name, reflection.name] - mapping.first.is_a?(Array) ? mapping : [mapping] - end end end |