Fix new rubocop warnings

This commit is contained in:
Tom Hughes 2024-10-15 18:25:30 +01:00
parent 67f28108ec
commit 99f220cf69
2 changed files with 2 additions and 2 deletions

View file

@ -234,7 +234,7 @@ class Relation < ApplicationRecord
element = model.lock("for share").find_by(:id => m[1]) element = model.lock("for share").find_by(:id => m[1])
# and check that it is OK to use. # 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 hash[m[1]] = true
end end

View file

@ -27,7 +27,7 @@ module GPX
point.timestamp = Time.parse(reader.read_string).utc point.timestamp = Time.parse(reader.read_string).utc
end end
when XML::Reader::TYPE_END_ELEMENT when XML::Reader::TYPE_END_ELEMENT
if reader.name == "trkpt" && point && point.valid? if reader.name == "trkpt" && point&.valid?
point.altitude ||= 0 point.altitude ||= 0
yield point yield point
@actual_points += 1 @actual_points += 1