Items.destroy doesn't work

why doesn’t this work
items.destroy if items = find(:all, :conditions => …)

right now i have this that works, but it seems ugly and inefficient.

if items = find(:all, :conditions => …)
items.each do |item|

there must be a better way

How about


Which will call the destroy callback methods (slow if you are
destroying many records).

If you don’t care about callbacks, use delete_all instead.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs