+ WayTag.transaction do
+ tags = self.tags
+
+ WayTag.delete_all(['id = ?', self.id])
+
+ tags.each do |k,v|
+ tag = WayTag.new
+ tag.k = k
+ tag.v = v
+ tag.id = self.id
+ tag.save!
+ end
+ end
+
+ WaySegment.transaction do
+ segs = self.segs
+
+ WaySegment.delete_all(['id = ?', self.id])
+
+ i = 1
+ segs.each do |n|
+ seg = WaySegment.new
+ seg.id = self.id
+ seg.segment_id = n
+ seg.sequence_id = i
+ seg.save!
+ i += 1
+ end