-
-
Notifications
You must be signed in to change notification settings - Fork 263
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
Rails/FindEach should ignore queries with lock
#389
Comments
Oddly, it doesn't reproduce on the master branch testing. Can you provide a display for |
sorry, I probably didn't explain it well in our case rubocop-rails proposes to change just in case rubocop -V
1.4.0 (using Parser 2.7.2.0, rubocop-ast 1.1.1, running on ruby 2.7.2 x86_64-darwin19)
- rubocop-performance 1.9.0
- rubocop-rails 2.8.1 |
…s/FindEach` cop Closes rubocop#389
…s/FindEach` cop Closes rubocop#389
…s/FindEach` cop Closes rubocop#389
…s/FindEach` cop Closes rubocop#389
…s/FindEach` cop Closes rubocop#389
[Fix #389] Add `IgnoredMethods` configuration option for `Rails/FindEach` cop
Is your feature request related to a problem? Please describe.
find_each
doesn't play well withlock
in query.example: https://dev.betterdoc.org/tools/2019/04/05/use-pessimistic-locking-to-make-long-running-tasks-in-rails-free-of-race-conditions.html
Describe the solution you'd like
add
lock
toIGNORED_METHODS
https://github.com/rubocop-hq/rubocop-rails/blob/master/lib/rubocop/cop/rails/find_each.rb#L25Describe alternatives you've considered
allow to configure
ignored_methods
for this copThe text was updated successfully, but these errors were encountered: