Sha256: be46484d03b2aaaab2beaa9d8d8aed69eb0230786f8555911b4cad4a17229287

Contents?: true

Size: 592 Bytes

Versions: 15

Compression:

Stored size: 592 Bytes

Contents

# frozen_string_literal: true

require 'securerandom'

class Admin::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,
        participation_state_event: :default,
        comment: :string,
      ).new object
    else
      super(object).tap do |obj|
        obj.form_properties event: :association
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
tramway-event-1.11.0.1 app/forms/admin/tramway/event/participant_form.rb
tramway-event-1.11 app/forms/admin/tramway/event/participant_form.rb
tramway-event-1.10.2 app/forms/admin/tramway/event/participant_form.rb
tramway-event-1.10.1 app/forms/admin/tramway/event/participant_form.rb
tramway-event-1.10.0.2 app/forms/admin/tramway/event/participant_form.rb
tramway-event-1.10.0.1 app/forms/admin/tramway/event/participant_form.rb
tramway-event-1.10 app/forms/admin/tramway/event/participant_form.rb
tramway-event-1.9.31.2 app/forms/admin/tramway/event/participant_form.rb
tramway-event-1.9.31.1 app/forms/admin/tramway/event/participant_form.rb
tramway-event-1.9.31 app/forms/admin/tramway/event/participant_form.rb
tramway-event-1.9.30 app/forms/admin/tramway/event/participant_form.rb
tramway-event-1.9.29 app/forms/admin/tramway/event/participant_form.rb
tramway-event-1.9.28.4 app/forms/admin/tramway/event/participant_form.rb
tramway-event-1.9.28.3 app/forms/admin/tramway/event/participant_form.rb
tramway-event-1.9.28.2 app/forms/admin/tramway/event/participant_form.rb