I'm using ActAsParanoid gem to soft delete some records, let's say the children. The parent is not paranoid, and I want that on destroy of the parent, the children get really destroyed.
class Parent < ApplicationRecord
has_many :children, dependent: :destroy
end
class Child < ApplicationRecord
act_as_paranoid
belongs_to :parent
end
I'm now seeing that the children are being soft deleted, preventing the parent to be destroyed because the reference in the child becomes invalid. How can I make the children be really destroyed after the parent gets destroyed? (I want to know if I can to avoid custom callbacks or not)
Update:
Using dependent: :delete_all
gives the same error if there is one of the children that had been previously deleted.