Sha256: 7d766a0cdc3da040448a59d3494794833ba99adc5479b608c320da71ab417619

Contents?: true

Size: 497 Bytes

Versions: 6

Compression:

Stored size: 497 Bytes

Contents

# frozen_string_literal: true

class Tramway::Event::ParticipantFormField < ::Tramway::Core::ApplicationRecord
  belongs_to :event, class_name: 'Tramway::Event::Event'

  enumerize :field_type, in: %i[text string numeric date_picker select checkbox], default: :text

  scope :inputs_list, -> { order(position: :asc) }

  def required
    options.present? && options.dig('validations', 'presence') == 'true'
  end

  def validations
    (options == '' ? {} : options)&.dig('validations')
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
tramway-event-1.12.9.1 app/models/tramway/event/participant_form_field.rb
tramway-event-1.12.9 app/models/tramway/event/participant_form_field.rb
tramway-event-1.12.8.2 app/models/tramway/event/participant_form_field.rb
tramway-event-1.12.8.1 app/models/tramway/event/participant_form_field.rb
tramway-event-1.12.8 app/models/tramway/event/participant_form_field.rb
tramway-event-1.12.7 app/models/tramway/event/participant_form_field.rb