Sha256: 81219b0ff1f78db44d9459f3470c1d74770925c16b7929680ac2ec9a223b1bb6

Contents?: true

Size: 583 Bytes

Versions: 8

Compression:

Stored size: 583 Bytes

Contents

# frozen_string_literal: true

require 'securerandom'

class Tramway::Event::ParticipantForm < ::Tramway::Core::ApplicationForm
  properties :participation_state_event, :comment
  association :event

  def self.new(object)
    if object.event_id.present?
      ::Tramway::Event::ParticipantExtendedFormCreator.create_form_class(
        SecureRandom.hex,
        object.event,
        comment: :string,
        participation_state_event: :string
      ).new object
    else
      super(object).tap do |obj|
        obj.form_properties event: :association
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
tramway-event-1.9.27.3 app/forms/tramway/event/participant_form.rb
tramway-event-1.9.27.2 app/forms/tramway/event/participant_form.rb
tramway-event-1.9.27.1 app/forms/tramway/event/participant_form.rb
tramway-event-1.9.27 app/forms/tramway/event/participant_form.rb
tramway-event-1.9.26 app/forms/tramway/event/participant_form.rb
tramway-event-1.9.25.1 app/forms/tramway/event/participant_form.rb
tramway-event-1.9.25 app/forms/tramway/event/participant_form.rb
tramway-event-1.9.24.1 app/forms/tramway/event/participant_form.rb