Class: SpreeCmCommissioner::TicketTransfers::Expire
- Inherits:
-
Object
- Object
- SpreeCmCommissioner::TicketTransfers::Expire
- Includes:
- Spree::ServiceModule::Base
- Defined in:
- app/services/spree_cm_commissioner/ticket_transfers/expire.rb
Instance Method Summary collapse
Instance Method Details
#call(ticket_transfer:) ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 |
# File 'app/services/spree_cm_commissioner/ticket_transfers/expire.rb', line 6 def call(ticket_transfer:) validate_expiration!(ticket_transfer) ActiveRecord::Base.transaction do ticket_transfer.from_guest.update!(state: :active) if should_activate_guest?(ticket_transfer) ticket_transfer.update!(state: :expired, completed_at: Time.zone.now) success(ticket_transfer: ticket_transfer) end rescue StandardError => e handle_failure(ticket_transfer, e) end |