Sha256: 79d6d36f2eb79ab610c6160cbb124b2c031281e6bac4f8fc67cfa4b528cf9644

Contents?: true

Size: 571 Bytes

Versions: 16

Compression:

Stored size: 571 Bytes

Contents

# frozen_string_literal: true

require 'securerandom'

class Tramway::Event::ParticipantForm < ::Tramway::Core::ApplicationForm
  properties :participation_state, :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: :string
      ).new object
    else
      super(object).tap do |obj|
        obj.form_properties event: :association
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
tramway-event-1.9.24 app/forms/tramway/event/participant_form.rb
tramway-event-1.9.23.2 app/forms/tramway/event/participant_form.rb
tramway-event-1.9.23.1 app/forms/tramway/event/participant_form.rb
tramway-event-1.9.23 app/forms/tramway/event/participant_form.rb
tramway-event-1.9.22 app/forms/tramway/event/participant_form.rb
tramway-event-1.9.21.1 app/forms/tramway/event/participant_form.rb
tramway-event-1.9.21 app/forms/tramway/event/participant_form.rb
tramway-event-1.9.20.1 app/forms/tramway/event/participant_form.rb
tramway-event-1.9.20 app/forms/tramway/event/participant_form.rb
tramway-event-1.9.19.8 app/forms/tramway/event/participant_form.rb
tramway-event-1.9.19.7 app/forms/tramway/event/participant_form.rb
tramway-event-1.9.19.6 app/forms/tramway/event/participant_form.rb
tramway-event-1.9.19.5 app/forms/tramway/event/participant_form.rb
tramway-event-1.9.19.4 app/forms/tramway/event/participant_form.rb
tramway-event-1.9.19.3 app/forms/tramway/event/participant_form.rb
tramway-event-1.9.19.2 app/forms/tramway/event/participant_form.rb