-
-
Notifications
You must be signed in to change notification settings - Fork 248
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
New cop: use bang modifiers for ActiveRecord methods in transactions #9
Comments
If a model was using strict validations, https://guides.rubyonrails.org/active_record_validations.html#strict-validations |
That's new to me. Rails always has something up its sleeve. A configurable boolean attribute |
Hmm, is there any opposition to adding such a cop for those who are not using strict validations? While that seems like a nice option, it would require more code changes, and in the meantime this cop would probably help a lot of people if it was available. With strict validations a simple version of this cop would have false positives, but someone using strict validations could just disable it? Not sure what level of static analysis could be done to figure out whether the class in question is using strict validations or not. |
Sorry for digging up on this old issue. But I think it still makes sense to have such a cop. I may not want to make all my validations strict, just the ones in an explicit transaction. |
Transactions in Rails:
I can put a PR together if I get the go-ahead.
The text was updated successfully, but these errors were encountered: