From 9466211d42ce7ecd921ef6804e77d199e1677d89 Mon Sep 17 00:00:00 2001 From: Rick Olson Date: Thu, 6 Apr 2006 20:10:44 +0000 Subject: fix calculations for the Oracle Adapter (closes #4626) [Michael Schoen] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4192 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- activerecord/lib/active_record/calculations.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/activerecord/lib/active_record/calculations.rb b/activerecord/lib/active_record/calculations.rb index b62d205201..d586bec8e6 100644 --- a/activerecord/lib/active_record/calculations.rb +++ b/activerecord/lib/active_record/calculations.rb @@ -145,7 +145,7 @@ module ActiveRecord protected def construct_calculation_sql(aggregate, aggregate_alias, options) #:nodoc: scope = scope(:find) - sql = ["SELECT #{aggregate} AS #{aggregate_alias}"] + sql = "SELECT #{aggregate} AS #{aggregate_alias}" sql << ", #{options[:group_field]} AS #{options[:group_alias]}" if options[:group] sql << " FROM #{table_name} " add_joins!(sql, options, scope) @@ -154,7 +154,7 @@ module ActiveRecord sql << " HAVING #{options[:having]}" if options[:group] && options[:having] sql << " ORDER BY #{options[:order]}" if options[:order] add_limit!(sql, options) - sql.join + sql end def execute_simple_calculation(operation, column_name, column, aggregate, aggregate_alias, options) #:nodoc: -- cgit v1.2.3