diff options
author | Jon Leighton <j@jonathanleighton.com> | 2012-05-03 00:47:50 +0100 |
---|---|---|
committer | Jon Leighton <j@jonathanleighton.com> | 2012-05-04 12:50:07 +0100 |
commit | 4bd9482a1a890c50264b4a9320e6853f1a0bde69 (patch) | |
tree | 2ce874f35c75b40210aed34949b2639c34251324 /activerecord/lib/active_record/dynamic_matchers.rb | |
parent | 75a22814ef331ebeb35ee827699fc4177984921f (diff) | |
download | rails-4bd9482a1a890c50264b4a9320e6853f1a0bde69.tar.gz rails-4bd9482a1a890c50264b4a9320e6853f1a0bde69.tar.bz2 rails-4bd9482a1a890c50264b4a9320e6853f1a0bde69.zip |
de-globalise method
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 |