Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make Rails/PluckInWhere aware of .ids #1213

Closed
ydakuka opened this issue Dec 13, 2023 · 1 comment · Fixed by #1216
Closed

Make Rails/PluckInWhere aware of .ids #1213

ydakuka opened this issue Dec 13, 2023 · 1 comment · Fixed by #1216
Labels
enhancement New feature or request

Comments

@ydakuka
Copy link

ydakuka commented Dec 13, 2023

Describe the solution you'd like

# bad
Post.where(user_id: User.active.ids)

# good
Post.where(user_id: User.active.select(:id))
@koic
Copy link
Member

koic commented Dec 13, 2023

In terms of functionality, it might be possible to extend Rails/PluckInWhere instead of creating a new cop.

@koic koic added the enhancement New feature or request label Dec 13, 2023
@ydakuka ydakuka changed the title Cop idea: IdsInWhere Make Rails/PluckInWhere aware of .ids Dec 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants