Sha256: 80ea1a669e3a7bce8f48a55f81afc3bff414aaf008f895bcb99b33409f583f5b
Contents?: true
Size: 427 Bytes
Versions: 10
Compression:
Stored size: 427 Bytes
Contents
module ActiveReporter module Aggregator class CountIf < ActiveReporter::Aggregator::Count def function "COUNT(#{expression} IN (#{values.map(&:to_s).join(',')}) OR NULL)" end def default_value super || 0 end private def values Array(opts[:values] || opts[:value] || true).compact end def column super || 'id' end end end end
Version data entries
10 entries across 10 versions & 1 rubygems