X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/8920a56133d24d328b774ef166a07949746e008a..6b6d922239e6b2d0c40181aa3ab8e5bd438aebe3:/app/models/node.rb diff --git a/app/models/node.rb b/app/models/node.rb index 2a64259c1..f8559dca7 100644 --- a/app/models/node.rb +++ b/app/models/node.rb @@ -232,10 +232,14 @@ class Node < ActiveRecord::Base def save_with_history! t = Time.now.getutc + + self.version += 1 + self.timestamp = t + Node.transaction do - self.version += 1 - self.timestamp = t - save! + # clone the object before saving it so that the original is + # still marked as dirty if we retry the transaction + clone.save! # Create a NodeTag tags = self.tags