Skip to content

Provide a column to grouped COUNT query

Igor Drozdov requested to merge cherry-pick-4c761206 into master

What does this MR do?

The line triggers the following warning:

DEPRECATION WARNING:
Dangerous query method (method whose arguments are used as raw SQL) called with non-attribute argument(s): "COUNT(\*) DESC".
Non-attribute arguments will be disallowed in Rails 6.1.
This method should not be called with user-provided values, such as request parameters or model attributes.
Known-safe values can be passed by wrapping them in Arel.sql().

Let's provide a column to fix this problem 👍

Related issue: #328517 (closed)

Edited by Igor Drozdov

Merge request reports