Sha256: e03dfa6962d49072eeb09f0e74a491b450851cd9a79c965bdba8c66fac14fe44

Contents?: true

Size: 648 Bytes

Versions: 5

Compression:

Stored size: 648 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)
    form_object = super object
    form_properties event: :association,
                    title: :string,
                    description: :string,
                    field_type: :default,
                    options: :text,
                    position: :numeric
    form_object
  end

  def options
    model.options&.to_json
  end

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

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
tramway-event-1.9.19.6 app/forms/tramway/event/participant_form_field_form.rb
tramway-event-1.9.19.5 app/forms/tramway/event/participant_form_field_form.rb
tramway-event-1.9.19.4 app/forms/tramway/event/participant_form_field_form.rb
tramway-event-1.9.19.3 app/forms/tramway/event/participant_form_field_form.rb
tramway-event-1.9.19.2 app/forms/tramway/event/participant_form_field_form.rb