Sha256: 36126cd652400f2db4a68403c60b5cbfdb07128e4e673013606d14bbcbd478b6

Contents?: true

Size: 176 Bytes

Versions: 9

Compression:

Stored size: 176 Bytes

Contents

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

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

Version data entries

9 entries across 9 versions & 1 rubygems

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