diff options
author | Andrew White <andyw@pixeltrix.co.uk> | 2013-05-10 08:37:03 -0700 |
---|---|---|
committer | Andrew White <andyw@pixeltrix.co.uk> | 2013-05-10 08:37:03 -0700 |
commit | a71119335e312acde8d346ffc8fe109b1a99f4bd (patch) | |
tree | ae32639d7d618a37a961ce969fab941ee682ad3a /activerecord/lib/active_record | |
parent | 4fa860728fe2ed8f248e9f3e89f0a144b8f314c8 (diff) | |
parent | afedb090f07b0ab4944fdfb2204edeaf9ae98383 (diff) | |
download | rails-a71119335e312acde8d346ffc8fe109b1a99f4bd.tar.gz rails-a71119335e312acde8d346ffc8fe109b1a99f4bd.tar.bz2 rails-a71119335e312acde8d346ffc8fe109b1a99f4bd.zip |
Merge pull request #10557 from arunagw/pluck-refactor-using-map
Using map. No need to run query again
Diffstat (limited to 'activerecord/lib/active_record')
-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 |