Skip to content

Commit

Permalink
Alias subquery used in calculations, to provide better compatibility …
Browse files Browse the repository at this point in the history
…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
mpolakis authored and tarmo committed Aug 24, 2008
1 parent e7b00c1 commit b6ad9a7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion activerecord/lib/active_record/calculations.rb
Expand Up @@ -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

Expand Down

1 comment on commit b6ad9a7

@adkron
Copy link
Contributor

@adkron adkron commented on b6ad9a7 Oct 2, 2008

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This commit breaks oracle calculations.

Please sign in to comment.