Class: ActiveReporter::Aggregator::Array

Inherits:
Base
  • Object
show all
Defined in:
lib/active_reporter/aggregator/array.rb

Instance Attribute Summary

Attributes inherited from Base

#name, #opts, #report

Instance Method Summary collapse

Methods inherited from Base

#default_value, #initialize, #sql_value_name

Constructor Details

This class inherits a constructor from ActiveReporter::Aggregator::Base

Instance Method Details

#aggregate(groups) ⇒ Object



4
5
6
7
# File 'lib/active_reporter/aggregator/array.rb', line 4

def aggregate(groups)
  fail InvalidParamsError, 'array agg is only supported in Postgres' unless ActiveReporter.database_type == :postgres
  super
end

#functionObject



9
10
11
# File 'lib/active_reporter/aggregator/array.rb', line 9

def function
  "ARRAY_AGG(#{expression})"
end