Permalink
Browse files

Using map. No need to run query again

  • Loading branch information...
1 parent 4fa8607 commit afedb090f07b0ab4944fdfb2204edeaf9ae98383 @arunagw arunagw committed May 10, 2013
Showing with 1 addition and 1 deletion.
  1. +1 −1 activerecord/lib/active_record/relation/calculations.rb
@@ -184,7 +184,7 @@ def pluck(column_name)
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

0 comments on commit afedb09

Please sign in to comment.