diff options
author | Matthew Draper <matthew@trebex.net> | 2014-08-26 23:58:06 +0930 |
---|---|---|
committer | Matthew Draper <matthew@trebex.net> | 2014-08-26 23:58:06 +0930 |
commit | 36836fa5e7c084c0dce2818577e6fd0cf815f786 (patch) | |
tree | bee0543d1c859c53a0268a5b31a8af17015f28ff /lib/arel/expressions.rb | |
parent | 53bc8426648cc93695525e8f12102cd416b2d772 (diff) | |
parent | 712c002af51700d128eb45996687600bb20c75a7 (diff) | |
download | rails-36836fa5e7c084c0dce2818577e6fd0cf815f786.tar.gz rails-36836fa5e7c084c0dce2818577e6fd0cf815f786.tar.bz2 rails-36836fa5e7c084c0dce2818577e6fd0cf815f786.zip |
Merge pull request #300 from jpcody/master
Allow for alias omission in aggregate expressions
Diffstat (limited to 'lib/arel/expressions.rb')
-rw-r--r-- | lib/arel/expressions.rb | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/arel/expressions.rb b/lib/arel/expressions.rb index fa18f15b67..d40268c292 100644 --- a/lib/arel/expressions.rb +++ b/lib/arel/expressions.rb @@ -5,23 +5,24 @@ module Arel end def sum - Nodes::Sum.new [self], Nodes::SqlLiteral.new('sum_id') + Nodes::Sum.new [self] end def maximum - Nodes::Max.new [self], Nodes::SqlLiteral.new('max_id') + Nodes::Max.new [self] end def minimum - Nodes::Min.new [self], Nodes::SqlLiteral.new('min_id') + Nodes::Min.new [self] end def average - Nodes::Avg.new [self], Nodes::SqlLiteral.new('avg_id') + Nodes::Avg.new [self] end def extract field Nodes::Extract.new [self], field end + end end |