diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2010-09-07 16:47:10 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2010-09-07 16:47:10 -0700 |
commit | a5d894ce566a21ec4c5db9df06be7f22a1690691 (patch) | |
tree | d8864f7baba0561c3cc63bcacbfda1134e15b556 /activerecord | |
parent | 0c7a4daaa14bcd74effb60a0c5f67fc7bc2037d1 (diff) | |
download | rails-a5d894ce566a21ec4c5db9df06be7f22a1690691.tar.gz rails-a5d894ce566a21ec4c5db9df06be7f22a1690691.tar.bz2 rails-a5d894ce566a21ec4c5db9df06be7f22a1690691.zip |
attributes should be constructed with table objects
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/lib/active_record/relation/calculations.rb | 2 |
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 077398c28a..a80ac40a2c 100644 --- a/activerecord/lib/active_record/relation/calculations.rb +++ b/activerecord/lib/active_record/relation/calculations.rb @@ -186,7 +186,7 @@ module ActiveRecord def execute_simple_calculation(operation, column_name, distinct) #:nodoc: column = if @klass.column_names.include?(column_name.to_s) - Arel::Attribute.new(@klass.unscoped, column_name) + Arel::Attribute.new(@klass.unscoped.table, column_name) else Arel::SqlLiteral.new(column_name == :all ? "*" : column_name.to_s) end |