From f1d1ea825cc8c4116f86c1478bb177c2e8dccd41 Mon Sep 17 00:00:00 2001 From: Manuel Bustillo Date: Sun, 17 Nov 2024 18:25:38 +0100 Subject: [PATCH] Recalculate simulations after removing a guest --- app/models/guest.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/models/guest.rb b/app/models/guest.rb index f729f4c..40c41be 100644 --- a/app/models/guest.rb +++ b/app/models/guest.rb @@ -36,6 +36,7 @@ class Guest < ApplicationRecord scope :potential, -> { where.not(status: %i[declined considered]) } after_save :recalculate_simulations, if: :saved_change_to_status? + after_destroy :recalculate_simulations has_many :seats, dependent: :delete_all