Sha256: f5bdd46d7e4e7badc9fdb22edc79035a5972fd50ec0f3369acd69455c7721e56

Contents?: true

Size: 352 Bytes

Versions: 9

Compression:

Stored size: 352 Bytes

Contents

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

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

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
active_reporter-0.6.2 lib/active_reporter/aggregator/array.rb
active_reporter-0.6.1 lib/active_reporter/aggregator/array.rb
active_reporter-0.6.0 lib/active_reporter/aggregator/array.rb
active_reporter-0.5.13 lib/active_reporter/aggregator/array.rb
active_reporter-0.5.12 lib/active_reporter/aggregator/array.rb
active_reporter-0.5.11 lib/active_reporter/aggregator/array.rb
active_reporter-0.5.10 lib/active_reporter/aggregator/array.rb
active_reporter-0.5.9 lib/active_reporter/aggregator/array.rb
active_reporter-0.5.8 lib/active_reporter/aggregator/array.rb