Sha256: 1f8b605efa831e5e2caa2e5f95fbc54820faa911d0a2a64289ca960d6adf707e

Contents?: true

Size: 576 Bytes

Versions: 14

Compression:

Stored size: 576 Bytes

Contents

# frozen_string_literal: true

class Tramway::Event::ParticipantFormFieldForm < ::Tramway::Core::ApplicationForm
  properties :title, :description, :field_type, :options, :position
  association :event

  def initialize(object)
    super(object).tap do
      form_properties event: :association,
        title: :string,
        description: :string,
        field_type: :default,
        options: :text,
        position: :numeric
    end
  end

  def options
    model.options&.to_json
  end

  def options=(value)
    super value == '' ? value : JSON.parse(value)
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
tramway-event-1.9.25.1 app/forms/tramway/event/participant_form_field_form.rb
tramway-event-1.9.25 app/forms/tramway/event/participant_form_field_form.rb
tramway-event-1.9.24.1 app/forms/tramway/event/participant_form_field_form.rb
tramway-event-1.9.24 app/forms/tramway/event/participant_form_field_form.rb
tramway-event-1.9.23.2 app/forms/tramway/event/participant_form_field_form.rb
tramway-event-1.9.23.1 app/forms/tramway/event/participant_form_field_form.rb
tramway-event-1.9.23 app/forms/tramway/event/participant_form_field_form.rb
tramway-event-1.9.22 app/forms/tramway/event/participant_form_field_form.rb
tramway-event-1.9.21.1 app/forms/tramway/event/participant_form_field_form.rb
tramway-event-1.9.21 app/forms/tramway/event/participant_form_field_form.rb
tramway-event-1.9.20.1 app/forms/tramway/event/participant_form_field_form.rb
tramway-event-1.9.20 app/forms/tramway/event/participant_form_field_form.rb
tramway-event-1.9.19.8 app/forms/tramway/event/participant_form_field_form.rb
tramway-event-1.9.19.7 app/forms/tramway/event/participant_form_field_form.rb