return old_way
end
- def save
- t = Time.now
- self.timestamp = t
- self.save
-
- WayTag.delete_all(['id = ?', self.id])
+ def save_with_dependencies
+ save()
+ self.reload()
self.tags.each do |k,v|
- tag = WayTag.new
+ tag = OldWayTag.new
tag.k = k
tag.v = v
tag.id = self.id
+ tag.version = self.version
tag.save
end
- WaySegment.delete_all(['id = ?', self.id])
-
i = 0
self.segs.each do |n|
- seg = WaySegment.new
+ seg = OldWaySegment.new
seg.id = self.id
seg.segment_id = n
- seg.sequence_id = i
+ seg.version = self.version
seg.save
- i += 1
end
-
- old_way = OldWay.from_way(self)
- old_way.save
end
def segs