Sha256: 20d36e7ae30e08f23af7f0a465a16319c1c09cbefc8aa53171c9d4e54af388f9

Contents?: true

Size: 357 Bytes

Versions: 15

Compression:

Stored size: 357 Bytes

Contents

require "active_support/concern"

module Groupdate
  module Relation
    extend ActiveSupport::Concern

    included do
      attr_accessor :groupdate_values
    end

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

Version data entries

15 entries across 15 versions & 2 rubygems

Version Path
groupdate-6.0.0 lib/groupdate/relation.rb
groupdate-5.2.4 lib/groupdate/relation.rb
groupdate-5.2.3 lib/groupdate/relation.rb
groupdate-5.2.2 lib/groupdate/relation.rb
groupdate-5.2.1 lib/groupdate/relation.rb
groupdate-5.2.0 lib/groupdate/relation.rb
groupdate-5.1.0 lib/groupdate/relation.rb
groupdate2-4.1.5 lib/groupdate/relation.rb
groupdate-5.0.0 lib/groupdate/relation.rb
groupdate-4.3.0 lib/groupdate/relation.rb
groupdate-4.2.0 lib/groupdate/relation.rb
groupdate-4.1.2 lib/groupdate/relation.rb
groupdate-4.1.1 lib/groupdate/relation.rb
groupdate-4.1.0 lib/groupdate/relation.rb
groupdate-4.0.2 lib/groupdate/relation.rb