X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/64146b4f3614854e6a0f8430f27261fe0a0ca26c..e7ab3de654be6d0d1877eaf031baffa66bc1ed24:/app/models/way.rb diff --git a/app/models/way.rb b/app/models/way.rb index 2d149863e..6573b9805 100644 --- a/app/models/way.rb +++ b/app/models/way.rb @@ -206,7 +206,7 @@ class Way < ActiveRecord::Base def preconditions_ok?(old_nodes = []) return false if nds.empty? - raise OSM::APITooManyWayNodesError.new(id, nds.length, MAX_NUMBER_OF_WAY_NODES) if nds.length > MAX_NUMBER_OF_WAY_NODES + raise OSM::APITooManyWayNodesError.new(id, nds.length, Settings.max_number_of_way_nodes) if nds.length > Settings.max_number_of_way_nodes # check only the new nodes, for efficiency - old nodes having been checked last time and can't # be deleted when they're in-use. @@ -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?