wedding-planner/app/use_cases/guests/update_use_case.rb
Manuel Bustillo 94d0a42ac1
All checks were successful
Check usage of free licenses / build-static-assets (pull_request) Successful in 54s
Add copyright notice / copyright_notice (pull_request) Successful in 1m31s
Run unit tests / unit_tests (pull_request) Successful in 3m42s
Fix undefined method
2024-11-03 13:56:10 +01:00

21 lines
486 B
Ruby

# Copyright (C) 2024 Manuel Bustillo
module Guests
class UpdateUseCase
private attr_reader :guest_ids, :params
def initialize(guest_ids:, params:)
@guest_ids = guest_ids
@params = params
end
def call
Guest.where(id: guest_ids).update!(params)
# TODO: Not all status transitions may require a table re-arrangement
TablesArrangement.delete_all
ActiveJob.perform_all_later(50.times.map { TableSimulatorJob.new })
end
end
end