Update a lot of objects

can i update in one query a group of objects? i’ve something like: objs
= Model.find(:all, :conditions => …)…can i do something like
objs.update_attribute(:active, true) ?
i can’t do a objs.each do |obj| obj.update_attribute
because it’s in a script which run every 5 minutes…and N could be 1
as could be 10000 :frowning:

Model.update_all ‘active = true’, ‘your conditions’

Cheers,
Yuri

On 6/3/07, mike [email protected] wrote:


Best regards,
Yuri L.