store.widgets.clear doesn't seem to be saved to the database. So I tried:
store.widgets.clear
store.widgets.each do |i| i.destroy end
And this only destroys half of the records in the database. Any suggestions on how I can delete the entire store collection?
I need to add .destroy_all (or do .clear) but haven't gotten to it. The problem you see with .each is that it iterates through the array on deletion. For now, you can do:
store.widgets.reverse.each(&:destroy)
I will prioritize destroy_all.