]> git.openstreetmap.org Git - rails.git/blobdiff - app/models/relation.rb
Creating consistency check for creation of nodes, way and relations. Moving some...
[rails.git] / app / models / relation.rb
index dd2d1c7d5f1e4f18e6ae10703e780e8825b0bb69..195090e4b1f2755593773bc1fafb4755c0f37e6d 100644 (file)
@@ -251,6 +251,16 @@ class Relation < ActiveRecord::Base
     self.visible = true
     save_with_history!
   end
+  
+  def create_with_history(user)
+    check_create_consistency(self, user)
+    if !self.preconditions_ok?
+      raise OSM::APIPreconditionFailedError.new
+    end
+    self.version = 0
+    self.visible = true
+    save_with_history!
+  end
 
   def preconditions_ok?
     # These are hastables that store an id in the index of all