X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/6c2093b29d74b145b85e61c4fff09b5f13afa0e5..9c83235f72aece554426751e334c1f0b4ccaea64:/app/models/way.rb?ds=sidebyside diff --git a/app/models/way.rb b/app/models/way.rb index d6f0011d9..c95a12122 100644 --- a/app/models/way.rb +++ b/app/models/way.rb @@ -127,7 +127,7 @@ class Way < ActiveRecord::Base ordered_nodes[nd.sequence_id] = nd.node_id.to_s if visible_nodes[nd.node_id] else # otherwise, manually go to the db to check things - ordered_nodes[nd.sequence_id] = nd.node_id.to_s if nd.node && nd.node.visible? + ordered_nodes[nd.sequence_id] = nd.node_id.to_s if nd.node&.visible? end end @@ -254,7 +254,7 @@ class Way < ActiveRecord::Base # to IDs +id_map+. def fix_placeholders!(id_map, placeholder_id = nil) nds.map! do |node_id| - if node_id < 0 + if node_id.negative? new_id = id_map[:node][node_id] raise OSM::APIBadUserInput, "Placeholder node not found for reference #{node_id} in way #{id.nil? ? placeholder_id : id}" if new_id.nil?