aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorAndrew White <andyw@pixeltrix.co.uk>2013-05-10 08:37:03 -0700
committerAndrew White <andyw@pixeltrix.co.uk>2013-05-10 08:37:03 -0700
commita71119335e312acde8d346ffc8fe109b1a99f4bd (patch)
treeae32639d7d618a37a961ce969fab941ee682ad3a /activerecord
parent4fa860728fe2ed8f248e9f3e89f0a144b8f314c8 (diff)
parentafedb090f07b0ab4944fdfb2204edeaf9ae98383 (diff)
downloadrails-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')
-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 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