Sha256: 8c078b9111fdd9ea44543922cd902d0ce7c64b0ae0dca096d3d38d28810f7af7

Contents?: true

Size: 184 Bytes

Versions: 9

Compression:

Stored size: 184 Bytes

Contents

module Prosperity
  class Aggregate::Average < Aggregate::WithColumn
    def to_sql
      "AVG(#{column})"
    end

    def apply(scope)
      scope.average(column)
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
prosperity-0.0.10 lib/prosperity/aggregate/average.rb
prosperity-0.0.9 lib/prosperity/aggregate/average.rb
prosperity-0.0.8 lib/prosperity/aggregate/average.rb
prosperity-0.0.7 lib/prosperity/aggregate/average.rb
prosperity-0.0.6 lib/prosperity/aggregate/average.rb
prosperity-0.0.5 lib/prosperity/aggregate/average.rb
prosperity-0.0.4 lib/prosperity/aggregate/average.rb
prosperity-0.0.3 lib/prosperity/aggregate/average.rb
prosperity-0.0.2 lib/prosperity/aggregate/average.rb