-
-
Notifications
You must be signed in to change notification settings - Fork 264
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/SaveBang "use create! instead of create" false positive #190
Comments
jas14
added a commit
to jas14/rubocop-rails
that referenced
this issue
Jan 22, 2020
…mmediately Fixes rubocop#190. Rails/SaveBang had a false positive when the return value of a `create` call was checked directly with a call to `persisted?`.
8 tasks
jas14
added a commit
to jas14/rubocop-rails
that referenced
this issue
Jan 22, 2020
…mmediately Fixes rubocop#190. Rails/SaveBang had a false positive when the return value of a `create` call was checked directly with a call to `persisted?`.
jas14
added a commit
to jas14/rubocop-rails
that referenced
this issue
Jan 24, 2020
…mmediately Fixes rubocop#190. Rails/SaveBang had a false positive when the return value of a `create` call was checked directly with a call to `persisted?`.
koic
added a commit
that referenced
this issue
Jan 24, 2020
[Fix #190] Fix `Rails/SaveBang` when return value is checked immediately
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The Rails/SaveBang cop has a false positive when the return value of a
create
call is checked immediately (i.e. without assignment to a variable).Expected behavior
I expect the cop to not fire when the return value is checked immediately.
Actual behavior
The cope fires when the return value is checked immediately:
Steps to reproduce the problem
Enable the Rails/SaveBang cop and run on the following small repro case:
RuboCop version
The text was updated successfully, but these errors were encountered: