]> git.openstreetmap.org Git - rails.git/blobdiff - app/models/way.rb
All API 0.6 functional tests now pass.
[rails.git] / app / models / way.rb
index 6a5ad58ab9635d36279acba547bbe1618815a9ed..341bc6e3ece589f3495e5d2e41a99626d12dba71 100644 (file)
@@ -219,6 +219,16 @@ class Way < ActiveRecord::Base
     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?
     return false if self.nds.empty?
     self.nds.each do |n|