Class: Prosperity::Aggregate::Maximum

Inherits:
WithColumn
  • Object
show all
Defined in:
lib/prosperity/aggregate/maximum.rb

Instance Attribute Summary

Attributes inherited from WithColumn

#column

Instance Method Summary collapse

Methods inherited from WithColumn

#initialize

Constructor Details

This class inherits a constructor from Prosperity::Aggregate::WithColumn

Instance Method Details

#apply(scope, options = {}) ⇒ Object



7
8
9
# File 'lib/prosperity/aggregate/maximum.rb', line 7

def apply(scope, options = {})
  scope.maximum(column)
end

#to_sqlObject



3
4
5
# File 'lib/prosperity/aggregate/maximum.rb', line 3

def to_sql
  "MAX(#{column})"
end