Enable Lint/RedundantSafeNavigation rubocop cop

This commit is contained in:
fatkodima 2023-09-27 14:52:10 +03:00
parent fb6c6007d0
commit 7ef86b6a49
5 changed files with 7 additions and 4 deletions

@ -243,6 +243,9 @@ Lint/RequireParentheses:
Lint/RedundantStringCoercion:
Enabled: true
Lint/RedundantSafeNavigation:
Enabled: true
Lint/UriEscapeUnescape:
Enabled: true

@ -32,7 +32,7 @@ def x_forwarded_to_addresses
private
def address_list(obj)
if obj&.respond_to?(:element)
if obj.respond_to?(:element)
# Mail 2.8+
obj.element
else

@ -860,7 +860,7 @@ def url_for(options, route_name = nil, url_strategy = UNKNOWN, method_name = nil
params = route_with_params.params
if options.key? :params
if options[:params]&.respond_to?(:to_hash)
if options[:params].respond_to?(:to_hash)
params.merge! options[:params]
else
params[:params] = options[:params]

@ -175,7 +175,7 @@ def set(options = {}) # :nodoc:
end
def scheduled_at=(value)
@_scheduled_at_time = if value&.is_a?(Numeric)
@_scheduled_at_time = if value.is_a?(Numeric)
ActiveJob.deprecator.warn(<<~MSG.squish)
Assigning a numeric/epoch value to scheduled_at is deprecated. Use a Time object instead.
MSG

@ -159,7 +159,7 @@ def change(options)
::Time.new(new_year, new_month, new_day, new_hour, new_min, new_sec, new_offset)
elsif utc?
::Time.utc(new_year, new_month, new_day, new_hour, new_min, new_sec)
elsif zone&.respond_to?(:utc_to_local)
elsif zone.respond_to?(:utc_to_local)
new_time = ::Time.new(new_year, new_month, new_day, new_hour, new_min, new_sec, zone)
# When there are two occurrences of a nominal time due to DST ending,