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

29 lines
401 B
Ruby
Raw Normal View History

2010-09-14 18:20:24 -04:00
module Arel
module Expressions
def count distinct = false
Nodes::Count.new [self], distinct
end
def sum
Nodes::Sum.new [self]
2010-09-14 18:20:24 -04:00
end
def maximum
Nodes::Max.new [self]
2010-09-14 18:20:24 -04:00
end
def minimum
Nodes::Min.new [self]
2010-09-14 18:20:24 -04:00
end
def average
Nodes::Avg.new [self]
2010-09-14 18:20:24 -04:00
end
def extract field
Nodes::Extract.new [self], field
end
2010-09-14 18:20:24 -04:00
end
end