diff options
author | Arun Agrawal <arunagw@gmail.com> | 2013-05-10 17:33:47 +0200 |
---|---|---|
committer | Arun Agrawal <arunagw@gmail.com> | 2013-05-10 17:33:47 +0200 |
commit | afedb090f07b0ab4944fdfb2204edeaf9ae98383 (patch) | |
tree | ae32639d7d618a37a961ce969fab941ee682ad3a | |
parent | 4fa860728fe2ed8f248e9f3e89f0a144b8f314c8 (diff) | |
download | rails-afedb090f07b0ab4944fdfb2204edeaf9ae98383.tar.gz rails-afedb090f07b0ab4944fdfb2204edeaf9ae98383.tar.bz2 rails-afedb090f07b0ab4944fdfb2204edeaf9ae98383.zip |
Using map. No need to run query again
-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 d4765a6782..afab793a0c 100644 --- a/activerecord/lib/active_record/relation/calculations.rb +++ b/activerecord/lib/active_record/relation/calculations.rb @@ -184,7 +184,7 @@ module ActiveRecord result = klass.connection.exec_query(select(column_name).to_sql) last_column = result.columns.last - klass.connection.select_all(select(column_name).arel).map! do |attributes| + result.map do |attributes| klass.type_cast_attribute(last_column, klass.initialize_attributes(attributes)) end end |