Sha256: 43a355790d185c79fca8845a3305fbfaa1a2c667b356b60c9ba9bcd9cbcdfda1

Contents?: true

Size: 617 Bytes

Versions: 63

Compression:

Stored size: 617 Bytes

Contents

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

63 entries across 63 versions & 1 rubygems

Version Path
tramway-event-1.2.1 app/forms/tramway/event/participant_form_field_form.rb
tramway-event-1.2 app/forms/tramway/event/participant_form_field_form.rb
tramway-event-1.1 app/forms/tramway/event/participant_form_field_form.rb