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
This commit is contained in:
Rick Olson
2006-04-06 20:10:44 +00:00
parent 496725022a
commit 9466211d42

View File

@@ -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: