Rename update element consistency check
This commit is contained in:
parent
09f6b83486
commit
349200fb0a
7 changed files with 34 additions and 7 deletions
|
@ -145,7 +145,7 @@ class Node < ApplicationRecord
|
|||
# shouldn't be possible to get race conditions.
|
||||
Node.transaction do
|
||||
lock!
|
||||
check_consistency(self, new_node, user)
|
||||
check_update_element_consistency(self, new_node, user)
|
||||
ways = Way.joins(:way_nodes).where(:visible => true, :current_way_nodes => { :node_id => id }).order(:id)
|
||||
raise OSM::APIPreconditionFailedError, "Node #{id} is still used by ways #{ways.collect(&:id).join(',')}." unless ways.empty?
|
||||
|
||||
|
@ -166,7 +166,7 @@ class Node < ApplicationRecord
|
|||
def update_from(new_node, user)
|
||||
Node.transaction do
|
||||
lock!
|
||||
check_consistency(self, new_node, user)
|
||||
check_update_element_consistency(self, new_node, user)
|
||||
|
||||
# update changeset first
|
||||
self.changeset_id = new_node.changeset_id
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue