Use ActiveRecord's .find_each instead of .each whenever possible#5380
Use ActiveRecord's .find_each instead of .each whenever possible#5380
.find_each instead of .each whenever possible#5380Conversation
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
.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: