From 712c002af51700d128eb45996687600bb20c75a7 Mon Sep 17 00:00:00 2001 From: Joshua Cody Date: Thu, 31 Jul 2014 07:49:57 -0500 Subject: Remove default aliases from aggregate functions --- lib/arel/expressions.rb | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) (limited to 'lib') diff --git a/lib/arel/expressions.rb b/lib/arel/expressions.rb index 717cf412ee..d40268c292 100644 --- a/lib/arel/expressions.rb +++ b/lib/arel/expressions.rb @@ -4,31 +4,25 @@ module Arel Nodes::Count.new [self], distinct end - def sum(alias_as = "sum_id") - Nodes::Sum.new [self], node_alias(alias_as) + def sum + Nodes::Sum.new [self] end - def maximum(alias_as = "max_id") - Nodes::Max.new [self], node_alias(alias_as) + def maximum + Nodes::Max.new [self] end - def minimum(alias_as = "min_id") - Nodes::Min.new [self], node_alias(alias_as) + def minimum + Nodes::Min.new [self] end - def average(alias_as = "avg_id") - Nodes::Avg.new [self], node_alias(alias_as) + def average + Nodes::Avg.new [self] end def extract field Nodes::Extract.new [self], field end - private - - def node_alias(alias_as) - alias_as.nil? ? nil : Nodes::SqlLiteral.new(alias_as) - end - end end -- cgit v1.2.3