- check_consistency(self, new_way, user)
- unless new_way.preconditions_ok?(self.nds)
- raise OSM::APIPreconditionFailedError.new("Cannot update way #{self.id}: data is invalid.")
+ Way.transaction do
+ self.lock!
+ check_consistency(self, new_way, user)
+ unless new_way.preconditions_ok?(self.nds)
+ raise OSM::APIPreconditionFailedError.new("Cannot update way #{self.id}: data is invalid.")
+ end
+
+ self.changeset_id = new_way.changeset_id
+ self.changeset = new_way.changeset
+ self.tags = new_way.tags
+ self.nds = new_way.nds
+ self.visible = true
+ save_with_history!