1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/lib/arel/expressions.rb

27 lines
532 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
def extract field
Nodes::Extract.new [self], field
end
end
end