You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think I found an issue with the autocorrection for a Rails file.
I applied rubocop autocorrection
bundle exec rubocop --rails -a
to a file that contains this line:
changes.each { |k, v| amended_data[k] = v if !amended_data[k] && k != 'amended_data' } unless changes['report_status'] if self.amended? || self.reported?
And the autocorrection resulted in this line change:
changes.each { |k, v| amended_data[k] = v if !amended_data[k] && k != 'amended_data' } if self.amended? || self.reported? && !changes['report_status']
However, this changes the logic if compared to the unless/if modifiers used on the original code because of missing parenthesis on the || clause.
The correct code output from the automatic correction should have been:
changes.each { |k, v| amended_data[k] = v if !amended_data[k] && k != 'amended_data' } if (self.amended? || self.reported?) && !changes['report_status']
Thanks!
The text was updated successfully, but these errors were encountered:
Hello,
I think I found an issue with the autocorrection for a Rails file.
I applied rubocop autocorrection
bundle exec rubocop --rails -a
to a file that contains this line:
And the autocorrection resulted in this line change:
However, this changes the logic if compared to the unless/if modifiers used on the original code because of missing parenthesis on the || clause.
The correct code output from the automatic correction should have been:
Thanks!
The text was updated successfully, but these errors were encountered: