At the end of that latter piece of code, product.prices.size still
equals 2.
For the record, I do know about delete_all, there are some
conditionals in my actual code that decide if an object gets deleted
or not. I’m just trying to figure out why my objects aren’t being
destroyed when inside a loop like that.

At the end of that latter piece of code, product.prices.size still
equals 2.
For the record, I do know about delete_all, there are some
conditionals in my actual code that decide if an object gets deleted
or not. I’m just trying to figure out why my objects aren’t being
destroyed when inside a loop like that.

What’s the database say after you do that? And what happens if you
follow
that up with a:

product.reload

I’d be really surprised if the database wasn’t adjusted after you did
that, but can see that product wouldn’t know it’s been updated as ‘p’ is
local and not really tied to ‘product’.