Skip to content
This repository
Browse code

Alias subquery used in calculations, to provide better compatibility …

…with databases such as MonetDB

Signed-off-by: Michael Koziarski <michael@koziarski.com>
Signed-off-by: Tom Ward <tom@popdog.net>
[#796 state:committed]
  • Loading branch information...
commit b6ad9a75ccf0e8734312357a7ac9dd7c47fd4cf1 1 parent e7b00c1
Michalis Polakis mpolakis authored tarmo committed

Showing 1 changed file with 1 addition and 1 deletion. Show diff stats Hide diff stats

  1. +1 1  activerecord/lib/active_record/calculations.rb
2  activerecord/lib/active_record/calculations.rb
@@ -211,7 +211,7 @@ def construct_calculation_sql(operation, column_name, options) #:nodoc:
211 211
212 212 sql << " ORDER BY #{options[:order]} " if options[:order]
213 213 add_limit!(sql, options, scope)
214   - sql << ')' if use_workaround
  214 + sql << ') AS #{aggregate_alias}_subquery' if use_workaround
215 215 sql
216 216 end
217 217

1 comment on commit b6ad9a7

Amos King

This commit breaks oracle calculations.

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