Skip to content
This repository
Browse code

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 authored April 06, 2006
4  activerecord/lib/active_record/calculations.rb
@@ -145,7 +145,7 @@ def calculate(operation, column_name, options = {})
145 145
       protected
146 146
         def construct_calculation_sql(aggregate, aggregate_alias, options) #:nodoc:
147 147
           scope = scope(:find)
148  
-          sql  = ["SELECT #{aggregate} AS #{aggregate_alias}"]
  148
+          sql  = "SELECT #{aggregate} AS #{aggregate_alias}"
149 149
           sql << ", #{options[:group_field]} AS #{options[:group_alias]}" if options[:group]
150 150
           sql << " FROM #{table_name} "
151 151
           add_joins!(sql, options, scope)
@@ -154,7 +154,7 @@ def construct_calculation_sql(aggregate, aggregate_alias, options) #:nodoc:
154 154
           sql << " HAVING #{options[:having]}" if options[:group] && options[:having]
155 155
           sql << " ORDER BY #{options[:order]}" if options[:order]
156 156
           add_limit!(sql, options)
157  
-          sql.join
  157
+          sql
158 158
         end
159 159
 
160 160
         def execute_simple_calculation(operation, column_name, column, aggregate, aggregate_alias, options) #:nodoc:

0 notes on commit 9466211

Please sign in to comment.
Something went wrong with that request. Please try again.