1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/activerecord/lib/arel/expressions.rb
2018-02-24 18:11:47 +10:30

29 lines
447 B
Ruby

# frozen_string_literal: true
module Arel # :nodoc: all
module Expressions
def count(distinct = false)
Nodes::Count.new [self], distinct
end
def sum
Nodes::Sum.new [self]
end
def maximum
Nodes::Max.new [self]
end
def minimum
Nodes::Min.new [self]
end
def average
Nodes::Avg.new [self]
end
def extract(field)
Nodes::Extract.new [self], field
end
end
end