aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2010-09-07 16:38:49 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2010-09-07 16:38:49 -0700
commit0c7a4daaa14bcd74effb60a0c5f67fc7bc2037d1 (patch)
treee1e9209ba09a55a2649a8fda7c1e1c6fb074f905 /activerecord
parentc6015cbcd8b6ed716c0add2874a17a495250ef0a (diff)
downloadrails-0c7a4daaa14bcd74effb60a0c5f67fc7bc2037d1.tar.gz
rails-0c7a4daaa14bcd74effb60a0c5f67fc7bc2037d1.tar.bz2
rails-0c7a4daaa14bcd74effb60a0c5f67fc7bc2037d1.zip
attributes should be associated with tables
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/lib/active_record/relation/calculations.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/relation/calculations.rb b/activerecord/lib/active_record/relation/calculations.rb
index ea364a3b30..077398c28a 100644
--- a/activerecord/lib/active_record/relation/calculations.rb
+++ b/activerecord/lib/active_record/relation/calculations.rb
@@ -211,7 +211,7 @@ module ActiveRecord
select_statement = if operation == 'count' && column_name == :all
"COUNT(*) AS count_all"
else
- Arel::Attribute.new(@klass.unscoped, column_name).send(operation).as(aggregate_alias).to_sql
+ Arel::Attribute.new(@klass.unscoped.table, column_name).send(operation).as(aggregate_alias).to_sql
end
select_statement << ", #{group_field} AS #{group_alias}"