rubocop-rails icon indicating copy to clipboard operation
rubocop-rails copied to clipboard

Cop requests: Merge ActiveRecord's multiple `where` into one

Open baado opened this issue 1 year ago • 2 comments

Is your feature request related to a problem? Please describe.

e.g. .where(column1: :a).where(column2: :b) -> .where(column1: :a, column2: :b)

Describe the solution you'd like

I'd like to auto fix it, maybe :)

Describe alternatives you've considered

Or, do we ourselves write these cops?

Additional context

I cut one out of #953 issue which describes multiple issues.

Technically, where.not etc need to be taken care of. Can you open this a new separate issue?

commented by @koic

baado avatar Mar 17 '23 07:03 baado

Hey @koic , do you need help with this one? I think I'll have couple of hours weekly free to work on OS and I'd be happy to help(with this one or with anything other) 😅

ktopolski avatar Apr 06 '23 11:04 ktopolski

Perhaps this is this cop that should be discussed first in the Rails style guide. Please open a proposal with the style guide first: https://github.com/rubocop/rails-style-guide

koic avatar Aug 14 '23 03:08 koic