Module: Groupdate::Relation

Extended by:
ActiveSupport::Concern
Defined in:
lib/groupdate/relation.rb

Instance Method Summary collapse

Instance Method Details

#calculate(*args, &block) ⇒ Object



11
12
13
14
# File 'lib/groupdate/relation.rb', line 11

def calculate(*args, &block)
  default_value = [:count, :sum].include?(args[0]) ? 0 : nil
  Groupdate.process_result(self, super, default_value: default_value)
end