モデルに👇のメソッド追加
before_destroy :prevent_destroy
def prevent_destroy
raise "Destroy is not allowed for Article model. Because article model has a soft delete feature. Use discard function instead of destroy."
end
物理削除しようとするとこうなる👇
irb(main):001:0> Article.destroy_all
/app/models/article.rb:31:in `prevent_destroy': Destroy is not allowed for Article model. Because article model has a soft delete feature. Use discard function instead of destroy. (RuntimeError)
これで安心😌