Add and apply Lint/RedundantSafeNavigation RuboCop rule

We've tested the updated behavior in RuboCop 1.69, found a new offense, and corrected it.
This commit is contained in:
taitus
2025-02-13 16:06:05 +01:00
parent 4c7fe8a5d9
commit f4ffee3700
2 changed files with 4 additions and 1 deletions

View File

@@ -311,6 +311,9 @@ Lint/NonAtomicFileOperation:
Lint/ParenthesesAsGroupedExpression:
Enabled: true
Lint/RedundantSafeNavigation:
Enabled: true
Lint/RedundantStringCoercion:
Enabled: true

View File

@@ -101,7 +101,7 @@ class Legislation::AnnotationsController < Legislation::BaseController
def convert_ranges_parameters
annotation = params[:legislation_annotation]
if annotation && annotation[:ranges]&.is_a?(String)
if annotation && annotation[:ranges].is_a?(String)
params[:legislation_annotation][:ranges] = JSON.parse(annotation[:ranges])
end
rescue JSON::ParserError