mirror of
https://github.com/github/rails.git
synced 2026-01-29 08:18:03 -05:00
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:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user