From 707f05d81c8c68ab916acc2f6fd54a798813a982 Mon Sep 17 00:00:00 2001 From: Manuel Bustillo Date: Sun, 26 Jan 2025 12:40:52 +0100 Subject: [PATCH] Remove automatic creation and deletion of simulations --- app/models/guest.rb | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/app/models/guest.rb b/app/models/guest.rb index ad0542f..d080679 100644 --- a/app/models/guest.rb +++ b/app/models/guest.rb @@ -41,16 +41,5 @@ class Guest < ApplicationRecord scope :potential, -> { where.not(status: %i[declined considered]) } - after_destroy :recalculate_simulations - after_save :recalculate_simulations, if: :saved_change_to_status? - has_many :seats, dependent: :delete_all - - private - - def recalculate_simulations - TablesArrangement.delete_all - - ActiveJob.perform_all_later(50.times.map { TableSimulatorJob.new(wedding_id) }) - end end