We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
When looking for SaveBang violations, if you have a save call as part of an if statement like this it passes:
raise 'saved' if user.save
But if I want to have it part of an chained clause it doesn't work.
raise 'saved' if user.valid? && user.save
if user.valid? && user.save should pass SaveBang cop
if user.valid? && user.save
It suggests I use save! instead
save!
0.42.0 (using Parser 2.3.1.2, running on ruby 2.3.1 x86_64-darwin15)
The text was updated successfully, but these errors were encountered:
Yep, that's a bug.
Sorry, something went wrong.
[Fix rubocop#3390] Fix SaveBang cop for multiple conditional
91ed9ef
[Fix #3390] Fix SaveBang cop for multiple conditional
e16b2c6
c5b359c
No branches or pull requests
When looking for SaveBang violations, if you have a save call as part of an if statement like this it passes:
But if I want to have it part of an chained clause it doesn't work.
Expected behavior
if user.valid? && user.save
should pass SaveBang copActual behavior
It suggests I use
save!
insteadSteps to reproduce the problem
raise 'saved' if user.valid? && user.save
RuboCop version
0.42.0 (using Parser 2.3.1.2, running on ruby 2.3.1 x86_64-darwin15)
The text was updated successfully, but these errors were encountered: