def expand_attribute_names_for_aggregates(attribute_names)
      attribute_names.map { |attribute_name|
        unless (aggregation = reflect_on_aggregation(attribute_name.to_sym)).nil?
          aggregate_mapping(aggregation).map do |field_attr, _|
            field_attr.to_sym
          end
        else
          attribute_name.to_sym
        end
      }.flatten
    end
def expand_attribute_names_for_aggregates(attribute_names)
      attribute_names.map { |attribute_name|
        unless (aggregation = reflect_on_aggregation(attribute_name.to_sym)).nil?
          aggregate_mapping(aggregation).map do |field_attr, _|
            field_attr.to_sym
          end
        else
          attribute_name.to_sym
        end
      }.flatten
    end
Similar in purpose to +expand_hash_conditions_for_aggregates+.