dependent: :destroyとdependent: :delete_allの違い【Rails】

関連モデルを一緒に削除してくれるdependent: :destroyとdependent: :delete_allについて、違いがよく分かってなかったのでまとめました。 モデルを用意 models/user.rb class User < ApplicationRecord has_many :articles end models/article.rb class Article < ApplicationRecord belongs_to :user end migration crea…