-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Use ActiveRecord's .find_each
instead of .each
whenever possible
#5380
Conversation
Codecov Report
@@ Coverage Diff @@
## main #5380 +/- ##
=======================================
Coverage 88.71% 88.71%
=======================================
Files 563 563
Lines 13896 13896
=======================================
Hits 12328 12328
Misses 1568 1568
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
7e573cc
to
d81437c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
.find_each
instead of .each
whenever possible
@elia I am upgrading to solidus 4.2 and was looking at this PR in the patch notes. I see that i.e. |
@elia we have the same Rubocop warnings in v4.1 as well. Do you think it is ok to backport this PR to v4.1 as well? There shouldn't be any breaking changes in here, right? |
@AdnanTheExcellent fully agree, can you please send a PR to fix that? I'd be happy to help merge it 🙏 |
Summary
Rubocop 1.56 was released introducing some changes around
Rails/FindEach
.Most changes are in specs and not-critical code, the few changes in core models seem innocuous or even improvements for some edge cases (e.g. a store with thousands of stock locations, which is admittedly unlikely anyway).
Checklist
Check out our PR guidelines for more details.
The following are mandatory for all PRs:
The following are not always needed: