Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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
  • Loading branch information...
commit 9466211d42ce7ecd921ef6804e77d199e1677d89 1 parent 4967250
risk danger olson technoweenie authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 activerecord/lib/active_record/calculations.rb
4 activerecord/lib/active_record/calculations.rb
View
@@ -145,7 +145,7 @@ def calculate(operation, column_name, options = {})
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 @@ def construct_calculation_sql(aggregate, aggregate_alias, options) #:nodoc:
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:
Please sign in to comment.
Something went wrong with that request. Please try again.