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

Suggestion: Add description about Active Record redundant all #339

Closed
masato-bkn opened this issue Jul 19, 2023 · 1 comment
Closed

Suggestion: Add description about Active Record redundant all #339

masato-bkn opened this issue Jul 19, 2023 · 1 comment

Comments

@masato-bkn
Copy link
Contributor

masato-bkn commented Jul 19, 2023

I suggest to add description about Active Record redundant all.

I often come across all used as receiver of Active Record query methods.

# bad
User.all.order(:created_at)
User.all.find(id)
User.all.where(id: ids)

# good
User.order(:created_at)
User.find(id)
User.where(id: ids)

In these cases, the output is same with or without all, so I think it's redundant and could be removed.

If there's a positive reaction to this issue, I plan to submit a PR.

@koic
Copy link
Member

koic commented Aug 10, 2023

@masato-bkn There is no issue if the redundant all method call will be removed. Can you open a PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants