Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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 with 1 addition and 1 deletion.
  1. +1 −1  activerecord/lib/active_record/calculations.rb
2  activerecord/lib/active_record/calculations.rb
View
@@ -211,7 +211,7 @@ def construct_calculation_sql(operation, column_name, options) #:nodoc:
sql << " ORDER BY #{options[:order]} " if options[:order]
add_limit!(sql, options, scope)
- sql << ')' if use_workaround
+ sql << ') AS #{aggregate_alias}_subquery' if use_workaround
sql
end

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.