]> git.openstreetmap.org Git - rails.git/blobdiff - app/models/node.rb
some more progress towards making amf_controller do version checking of nodes before...
[rails.git] / app / models / node.rb
index ce2bd5c74aa4eb6d45fdfabab0e094333db1c64d..f2ad3a78add2196f117214816489d3c7bdc686cb 100644 (file)
@@ -83,6 +83,7 @@ class Node < ActiveRecord::Base
     raise OSM::APIBadXMLError.new("node", pt, "lon missing") if pt['lon'].nil?
     node.lat = pt['lat'].to_f
     node.lon = pt['lon'].to_f
+    raise OSM::APIBadXMLError.new("node", pt, "changeset id missing") if pt['changeset'].nil?
     node.changeset_id = pt['changeset'].to_i
 
     raise OSM::APIBadUserInput.new("The node is outside this world") unless node.in_world?
@@ -99,15 +100,10 @@ class Node < ActiveRecord::Base
 
     # visible if it says it is, or as the default if the attribute
     # is missing.
-    node.visible = pt['visible'].nil? or pt['visible'] == 'true'
+    # Don't need to set the visibility, when it is set explicitly in the create/update/delete
+    #node.visible = pt['visible'].nil? or pt['visible'] == 'true'
 
-    if create
-      node.timestamp = Time.now
-    else
-      if pt['timestamp']
-        node.timestamp = Time.parse(pt['timestamp'])
-      end
-    end
+    # We don't care about the time, as it is explicitly set on create/update/delete
 
     tags = []