Exception: SpreeCmCommissioner::ReservedBlocks::LockedByOperatorError

Inherits:
StandardError
  • Object
show all
Defined in:
app/errors/spree_cm_commissioner/reserved_blocks/locked_by_operator_error.rb

Overview

Raised when a customer tries to hold or reserve a seat an operator has taken off sale.

The customer-facing message deliberately says only "not available" — it must not leak the operator's reason (e.g. "held for staff"), which lives in private_metadata.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(block_label = nil) ⇒ LockedByOperatorError

Returns a new instance of LockedByOperatorError.



10
11
12
13
# File 'app/errors/spree_cm_commissioner/reserved_blocks/locked_by_operator_error.rb', line 10

def initialize(block_label = nil)
  @block_label = block_label
  super()
end

Instance Attribute Details

#block_labelObject (readonly)

Returns the value of attribute block_label.



8
9
10
# File 'app/errors/spree_cm_commissioner/reserved_blocks/locked_by_operator_error.rb', line 8

def block_label
  @block_label
end

Instance Method Details

#messageObject

override



16
17
18
19
20
21
22
# File 'app/errors/spree_cm_commissioner/reserved_blocks/locked_by_operator_error.rb', line 16

def message
  if block_label.present?
    I18n.t('line_item.validation.blocks_are_locked_by_operator_with_label', label: block_label)
  else
    I18n.t('line_item.validation.blocks_are_locked_by_operator')
  end
end