Navigation Menu

Skip to content

Commit

Permalink
Fix TypeError: no implicit conversion of Arel::Attributes::Attribute …
Browse files Browse the repository at this point in the history
…into String
  • Loading branch information
bdewater committed Jul 28, 2018
1 parent 5b81bb1 commit 27c6c07
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion activerecord/lib/active_record/relation/calculations.rb
Expand Up @@ -245,7 +245,7 @@ def perform_calculation(operation, column_name)
if distinct && (group_values.any? || select_values.empty? && order_values.empty?)
column_name = primary_key
end
elsif /\s*DISTINCT[\s(]+/i.match?(column_name)
elsif /\s*DISTINCT[\s(]+/i.match?(column_name.to_s)
distinct = nil
end
end
Expand Down

0 comments on commit 27c6c07

Please sign in to comment.