Redo simulations lifecycle #222

Merged
bustikiller merged 6 commits from table-arrangements-guest-digest into main 2025-01-26 12:53:22 +00:00
Showing only changes of commit 707f05d81c - Show all commits

View File

@ -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