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:
@@ -311,6 +311,9 @@ Lint/NonAtomicFileOperation:
|
|||||||
Lint/ParenthesesAsGroupedExpression:
|
Lint/ParenthesesAsGroupedExpression:
|
||||||
Enabled: true
|
Enabled: true
|
||||||
|
|
||||||
|
Lint/RedundantSafeNavigation:
|
||||||
|
Enabled: true
|
||||||
|
|
||||||
Lint/RedundantStringCoercion:
|
Lint/RedundantStringCoercion:
|
||||||
Enabled: true
|
Enabled: true
|
||||||
|
|
||||||
|
|||||||
@@ -101,7 +101,7 @@ class Legislation::AnnotationsController < Legislation::BaseController
|
|||||||
|
|
||||||
def convert_ranges_parameters
|
def convert_ranges_parameters
|
||||||
annotation = params[:legislation_annotation]
|
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])
|
params[:legislation_annotation][:ranges] = JSON.parse(annotation[:ranges])
|
||||||
end
|
end
|
||||||
rescue JSON::ParserError
|
rescue JSON::ParserError
|
||||||
|
|||||||
Reference in New Issue
Block a user