From 99f220cf69304a29fb587c5d78c54a145caba111 Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Tue, 15 Oct 2024 18:25:30 +0100 Subject: [PATCH] Fix new rubocop warnings --- app/models/relation.rb | 2 +- lib/gpx.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/relation.rb b/app/models/relation.rb index f09647320..69e2acfd1 100644 --- a/app/models/relation.rb +++ b/app/models/relation.rb @@ -234,7 +234,7 @@ class Relation < ApplicationRecord element = model.lock("for share").find_by(:id => m[1]) # and check that it is OK to use. - raise OSM::APIPreconditionFailedError, "Relation with id #{id} cannot be saved due to #{m[0]} with id #{m[1]}" unless element&.visible? && element&.preconditions_ok? + raise OSM::APIPreconditionFailedError, "Relation with id #{id} cannot be saved due to #{m[0]} with id #{m[1]}" unless element&.visible? && element.preconditions_ok? hash[m[1]] = true end diff --git a/lib/gpx.rb b/lib/gpx.rb index 1bf7764ec..45a4dcf5f 100644 --- a/lib/gpx.rb +++ b/lib/gpx.rb @@ -27,7 +27,7 @@ module GPX point.timestamp = Time.parse(reader.read_string).utc end when XML::Reader::TYPE_END_ELEMENT - if reader.name == "trkpt" && point && point.valid? + if reader.name == "trkpt" && point&.valid? point.altitude ||= 0 yield point @actual_points += 1 -- 2.39.5