On 25/01/2008, SteveC <[EMAIL PROTECTED]> wrote: > Richards stuff does a lot of things through mass updates... If I > delete all the nodes in a way then I dont want to find them all and > delete them all. You can instead do > > Node.delete([1,2,3,4,5]) > > in rails and so things like > > Node.update([1,2,3,4,5], :visible => false, :used_id = 42) > > which is one query instead of 100,000 right?
Nope. It might look like it, but it isn't - if you look at the source you'll see rails does when you do that is look calling update on each id. That then calls update_attributes for the record, which just updates self and does save (which will trigger the before_save to update the tile number). So do that if you want - it may look the code look nice and tidy - but tile updating should still work and it is no more efficient than looping. Tom -- Tom Hughes ([EMAIL PROTECTED]) http://www.compton.nu/ _______________________________________________ dev mailing list [email protected] http://lists.openstreetmap.org/cgi-bin/mailman/listinfo/dev

