Sha256: 4fd48759c911e8cd3036b36aa6d905c1e6f86a292cd46ec6470ccdce75fada39

Contents?: true

Size: 652 Bytes

Versions: 1

Compression:

Stored size: 652 Bytes

Contents

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

  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 event=(value)
    super ::Tramway::Event::Event.find value
  end

  def options
    model.options.to_json
  end

  def options=(value)
    super JSON.parse value
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
tramway-event-1.0.1 app/forms/tramway/event/participant_form_field_form.rb