-
-
Notifications
You must be signed in to change notification settings - Fork 261
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
Autocorrect problem with Rails/Presence in the case of a multiplication #776
Labels
bug
Something isn't working
Comments
koic
added a commit
to koic/rubocop-rails
that referenced
this issue
Sep 15, 2022
Fixes rubocop#776. This PR fixes an incorrect autocorrect for `Rails/Presence` when using arithmetic operation in `else` branch.
9 tasks
koic
added a commit
to koic/rubocop-rails
that referenced
this issue
Sep 15, 2022
Fixes rubocop#776. This PR fixes an incorrect autocorrect for `Rails/Presence` when using arithmetic operation in `else` branch.
koic
added a commit
that referenced
this issue
Sep 19, 2022
…ils_presence [Fix #776] Fix an incorrect autocorrect for `Rails/Presence`
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In my case (see below) the
Rails/Presence
cops does not correctly correct the case of a multiplication, which produces a Zeitwerk error.Expected behavior
There should be a space between the parenthesis and the * or remove the parenthesis and add a space between the * and the float/integer.
Actual behavior
I have this error :
C: [Correctable] Rails/Presence: Use variable.presence || price.to_f *(12.0) instead of if variable.present?
and when I execute
rubocop -a
, it corrects :annual_contribution.presence || month_price.to_f *(12.0)
it gives me this error when I run
bin/rails zeitwerk:check
:Steps to reproduce the problem
and run
rubocop -a
RuboCop version
The text was updated successfully, but these errors were encountered: