method

calculate

rails latest stable - Class: ActiveRecord::NullRelation

Method deprecated or moved

This method is deprecated or moved on the latest stable version. The last existing version (v7.0.0) is shown here.

calculate(operation, _column_name)
public

No documentation available.

# File activerecord/lib/active_record/null_relation.rb, line 41
    def calculate(operation, _column_name)
      case operation
      when :count, :sum
        group_values.any? ? Hash.new : 0
      when :average, :minimum, :maximum
        group_values.any? ? Hash.new : nil
      end
    end