]> git.openstreetmap.org Git - rails.git/blobdiff - app/models/old_way.rb
way stuff, now creates correctly
[rails.git] / app / models / old_way.rb
index 820437fcefbe0211d66b70992437ad2e6a901626..db0108ea8f47232c0754899cb216a653579e4700 100644 (file)
@@ -14,15 +14,15 @@ class OldWay < ActiveRecord::Base
   end
 
   def save_with_dependencies
   end
 
   def save_with_dependencies
-    t = Time.now
-    self.timestamp = t
-    self.save
-    
+    save()
+    self.reload()
+
     self.tags.each do |k,v|
       tag = OldWayTag.new
       tag.k = k
       tag.v = v
       tag.id = self.id
     self.tags.each do |k,v|
       tag = OldWayTag.new
       tag.k = k
       tag.v = v
       tag.id = self.id
+      tag.version = self.version
       tag.save
     end
 
       tag.save
     end
 
@@ -31,13 +31,9 @@ class OldWay < ActiveRecord::Base
       seg = OldWaySegment.new
       seg.id = self.id
       seg.segment_id = n
       seg = OldWaySegment.new
       seg.id = self.id
       seg.segment_id = n
-      seg.sequence_id = i
+      seg.version = self.version
       seg.save
       seg.save
-      i += 1
     end
     end
-
-    old_way = OldWay.from_way(self)
-    old_way.save
   end
 
   def segs
   end
 
   def segs