From cb3e669b0df3a962a82b9c47933d65b1a24762b8 Mon Sep 17 00:00:00 2001 From: Jay Pignata Date: Fri, 14 Aug 2009 23:54:37 -0400 Subject: Fix calculation tests on sqlite2 [#3053 state:resolved] Signed-off-by: Pratik Naik --- activerecord/lib/active_record/calculations.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/activerecord/lib/active_record/calculations.rb b/activerecord/lib/active_record/calculations.rb index 4a88c43dff..646fed1a0b 100644 --- a/activerecord/lib/active_record/calculations.rb +++ b/activerecord/lib/active_record/calculations.rb @@ -197,7 +197,7 @@ module ActiveRecord sql << ", #{options[:group_field]} AS #{options[:group_alias]}" if options[:group] if options[:from] sql << " FROM #{options[:from]} " - elsif scope && scope[:from] + elsif scope && scope[:from] && !use_workaround sql << " FROM #{scope[:from]} " else sql << " FROM (SELECT #{distinct}#{column_name}" if use_workaround -- cgit v1.2.3