From 8f9f1d3136ce679d4920a894d50b0511ec49e6e1 Mon Sep 17 00:00:00 2001 From: Katlyn Alo <26312638+Kat-Alo@users.noreply.github.com> Date: Thu, 28 Sep 2023 16:12:56 -0600 Subject: [PATCH] using miss hannigan to nullify child to parent relationship before destroy --- app/models/page.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/page.rb b/app/models/page.rb index e2ba5081..bb372502 100644 --- a/app/models/page.rb +++ b/app/models/page.rb @@ -1,7 +1,7 @@ class Page < ApplicationRecord belongs_to :user - has_many :page_snapshots, dependent: :destroy + has_many :page_snapshots, dependent: :nullify_then_purge attr_accessor :subscriptions # Gets set in controller on update/create after_create :update_subscriptions