expressions.rb 462 B

1234567891011121314151617181920212223
  1. module Arel
  2. module Expressions
  3. def count distinct = false
  4. Nodes::Count.new [self], distinct
  5. end
  6. def sum
  7. Nodes::Sum.new [self], Nodes::SqlLiteral.new('sum_id')
  8. end
  9. def maximum
  10. Nodes::Max.new [self], Nodes::SqlLiteral.new('max_id')
  11. end
  12. def minimum
  13. Nodes::Min.new [self], Nodes::SqlLiteral.new('min_id')
  14. end
  15. def average
  16. Nodes::Avg.new [self], Nodes::SqlLiteral.new('avg_id')
  17. end
  18. end
  19. end