Permalink
Browse files

only deal with strings internally

  • Loading branch information...
tenderlove committed Jul 2, 2013
1 parent 11c2e80 commit b7aba569c871e09fa8227175626ff09e7e6638de
Showing with 3 additions and 3 deletions.
  1. +3 −3 activerecord/lib/active_record/relation/calculations.rb
@@ -138,9 +138,9 @@ def calculate(operation, column_name, options = {})
def pluck(*column_names)
column_names.map! do |column_name|
if column_name.is_a?(Symbol) && attribute_alias?(column_name)
- attribute_alias(column_name).to_sym
+ attribute_alias(column_name)
else
- column_name
+ column_name.to_s
end
end
@@ -149,7 +149,7 @@ def pluck(*column_names)
else
relation = spawn
relation.select_values = column_names.map { |cn|
- columns_hash.key?(cn.to_s) ? arel_table[cn] : cn
+ columns_hash.key?(cn) ? arel_table[cn] : cn
}
result = klass.connection.select_all(relation.arel, nil, bind_values)
columns = result.columns.map do |key|

0 comments on commit b7aba56

Please sign in to comment.