Why are you using delete_if as opposed to using a scope?

You could probably even put the scope on the Product's has_many relationship. That way #product_accessories and #accessories will always be non-deleted accessories. Only OrderDetail needs to be able to access deleted accessories.