-
-
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/TransactionExitStatement - Inspect #with_lock
method too
#710
Rails/TransactionExitStatement - Inspect #with_lock
method too
#710
Conversation
d2722f5
to
07d4157
Compare
07d4157
to
74c608a
Compare
`ActiveRecord::Locking::Pessimistic#with_lock` implicitly opens a transaction, so we should inspect this method as well as `ActiveRecord::Transactions#transaction`.
74c608a
to
7502d86
Compare
Thanks! |
Having dug around the Rails discussions, I noticed this change rails/rails#39453 was committed which seems to make this cop condition not applicable. I'm using |
@javierjulio I see, I didn't dig into how this deprecation was implemented in Rails, and wasn't aware of "no warning if not written" (rails/rails#39453). If I'm understanding rails/rails#39453 correctly, neither should |
@FunnyHector yes, I think you're right. My main concern was just with |
@javierjulio I'll raise an issue for this. Thanks for this opportunity to learn more about Rails 👍 |
@FunnyHector sounds good, thank you! ❤️ |
ActiveRecord::Locking::Pessimistic#with_lock
implicitly opens a transaction, so we should inspect this method as well asActiveRecord::Transactions#transaction
.Before submitting the PR make sure the following are checked:
[Fix #issue-number]
(if the related issue exists).master
(if not - rebase it).bundle exec rake default
. It executes all tests and runs RuboCop on its own code.{change_type}_{change_description}.md
if the new code introduces user-observable changes. See changelog entry format for details.