method
calculate
v4.2.1 -
Show latest stable
- Class:
ActiveRecord::NullRelation
calculate(operation, _column_name, _options = {})public
No documentation available.
# File activerecord/lib/active_record/null_relation.rb, line 64
def calculate(operation, _column_name, _options = {})
# TODO: Remove _options argument as soon we remove support to
# activerecord-deprecated_finders.
if [:count, :sum, :size].include? operation
group_values.any? ? Hash.new : 0
elsif [:average, :minimum, :maximum].include?(operation) && group_values.any?
Hash.new
else
nil
end
end