Flowdock
method

calculate

Importance_0
Ruby on Rails latest stable (v4.1.8) - 0 notes - Class: NullRelation
calculate(operation, _column_name, _options = {}) public

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Hide source
# 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
Register or log in to add new notes.