mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
23 lines
462 B
Ruby
23 lines
462 B
Ruby
module Arel
|
|
module Expressions
|
|
def count distinct = false
|
|
Nodes::Count.new [self], distinct
|
|
end
|
|
|
|
def sum
|
|
Nodes::Sum.new [self], Nodes::SqlLiteral.new('sum_id')
|
|
end
|
|
|
|
def maximum
|
|
Nodes::Max.new [self], Nodes::SqlLiteral.new('max_id')
|
|
end
|
|
|
|
def minimum
|
|
Nodes::Min.new [self], Nodes::SqlLiteral.new('min_id')
|
|
end
|
|
|
|
def average
|
|
Nodes::Avg.new [self], Nodes::SqlLiteral.new('avg_id')
|
|
end
|
|
end
|
|
end
|