Class: SpreeCmCommissioner::SeatLayout
- Includes:
- StoreMetadata
- Defined in:
- app/models/spree_cm_commissioner/seat_layout.rb
Instance Method Summary collapse
- #background_svg_url ⇒ Object
-
#mapped_sections? ⇒ Boolean
Any section or block has been converted from the background artwork — i.e.
Instance Method Details
#background_svg_url ⇒ Object
50 51 52 53 54 |
# File 'app/models/spree_cm_commissioner/seat_layout.rb', line 50 def background_svg_url return nil unless background_svg.attached? Rails.application.routes.url_helpers.cdn_image_url(background_svg) end |
#mapped_sections? ⇒ Boolean
Any section or block has been converted from the background artwork — i.e. there is something for a customer to tap. Used by the "nothing converted yet" index-card state and the activation guard that refuses to go live with an unmapped background.
59 60 61 |
# File 'app/models/spree_cm_commissioner/seat_layout.rb', line 59 def mapped_sections? seat_sections.where.not(shape_path: nil).exists? || blocks.where.not(shape_path: nil).exists? end |