Class: SpreeCmCommissioner::Block

Inherits:
Base
  • Object
show all
Defined in:
app/models/spree_cm_commissioner/block.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.seatable?(block_type) ⇒ Boolean

Returns:

  • (Boolean)


33
34
35
# File 'app/models/spree_cm_commissioner/block.rb', line 33

def self.seatable?(block_type)
  block_type.to_s.in?(%w[sleeping_seat seat])
end

Instance Method Details

#assign_layout_from_sectionObject



41
42
43
# File 'app/models/spree_cm_commissioner/block.rb', line 41

def assign_layout_from_section
  self.seat_layout = seat_section.seat_layout
end

#label_required?Boolean

Returns:

  • (Boolean)


29
30
31
# File 'app/models/spree_cm_commissioner/block.rb', line 29

def label_required?
  seatable? || %w[other text].include?(block_type.to_s)
end

#seatable?Boolean

Returns:

  • (Boolean)


37
38
39
# File 'app/models/spree_cm_commissioner/block.rb', line 37

def seatable?
  self.class.seatable?(block_type)
end