From c7375d74d9fff3219d4ea389ba9e36a90afe9d33 Mon Sep 17 00:00:00 2001 From: Michalis Polakis Date: Mon, 11 Aug 2008 14:53:24 +0100 Subject: Alias subquery used in calculations, to provide better compatibility with databases such as MonetDB Signed-off-by: Michael Koziarski Signed-off-by: Tom Ward [#796 state:committed] --- activerecord/lib/active_record/calculations.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activerecord/lib/active_record/calculations.rb') diff --git a/activerecord/lib/active_record/calculations.rb b/activerecord/lib/active_record/calculations.rb index 2ca1a0aaa3..246f87b7a9 100644 --- a/activerecord/lib/active_record/calculations.rb +++ b/activerecord/lib/active_record/calculations.rb @@ -211,7 +211,7 @@ module ActiveRecord 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 -- cgit v1.2.3