You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This uses ActiveRecord::Relation query objects and appends a bunch of query conditions into one query. I do return a query object here, but each addition returns a new Relation object so it needs to be passed on to the next call to reduce.
Maybe the cop just needs to be disabled with # rubocop:disable here, but it seems like this cop should be checking for a exact match on the return value. For example if the methods looked like this:
I'm pretty sure I've found a bug in the EachWithObject cop. It flags this call to
reduce
as one which should be changed toeach_with_object
This uses ActiveRecord::Relation query objects and appends a bunch of query conditions into one query. I do return a query object here, but each addition returns a new Relation object so it needs to be passed on to the next call to reduce.
Maybe the cop just needs to be disabled with
# rubocop:disable
here, but it seems like this cop should be checking for a exact match on the return value. For example if the methods looked like this:then I would expect it to be flagged.
The text was updated successfully, but these errors were encountered: