class ActiveReporter::Aggregator::CountIf
Public Instance Methods
default_value()
click to toggle source
Calls superclass method
ActiveReporter::Aggregator::Count#default_value
# File lib/active_reporter/aggregator/count_if.rb, line 8 def default_value super || 0 end
function()
click to toggle source
# File lib/active_reporter/aggregator/count_if.rb, line 4 def function "COUNT(#{expression} IN (#{values.map(&:to_s).join(',')}) OR NULL)" end
Private Instance Methods
column()
click to toggle source
Calls superclass method
ActiveReporter::Aggregator::Count#column
# File lib/active_reporter/aggregator/count_if.rb, line 18 def column super || 'id' end
values()
click to toggle source
# File lib/active_reporter/aggregator/count_if.rb, line 14 def values Array(opts[:values] || opts[:value] || true).compact end