:dependent => :delete_all not working

I’m having similar problems with :dependent => :destroy not destroying or deleting the dependent records. I’m having to just call association.clear in the after_destroy. Oddly, using association.clear in the before_destroy isn’t working for me either. It feels like there’s something going on preventing the association#destroy to fail but I don’t have time to spend trying to figure it out this time. You’re not alone on this though.

RSL

I must be missing something because it doesn’t seem reasonable to me that :dependent => :destroy wouldn’t be allowed to destroy the associated object. I must be missing something.

RSL

I feel really stupid right now but obviously I’ve missed something. I don’t see that you [or I] are trying to replace any objects but destroy them. Sorry for being so thick about this but I’m honestly confused. I presumed that the problem was some kind of reference somewhere that I did wrong and because it couldn’t clear, the associated object never deletes.

RSL

Gotcha. I thought I was missing someething. :slight_smile: