increment = 1000
offset = 0
id_max = OldNode.find(:first, :order => 'id desc').id
-
+
while offset < (id_max + increment)
hash = {}
#should be offsetting not selecting
OldNode.find(:all, :limit => increment, :offset => offset, :order => 'timestamp').each do |node|
if hash[node.id].nil?
- hash[node.id] = []
+ hash[node.id] = []
end
hash[node.id] << node
end
temp_old_node.tile = node.tile
temp_old_node.version = n
temp_old_node.save! || raise
- n +=1
+ n +=1
end
end
offset += increment
end
end
end
-
-
-
-
-
-