Sha256: b72675103edb312992e152253c58ca83501f34349be12d8a88c4e66049ece2b0

Contents?: true

Size: 591 Bytes

Versions: 26

Compression:

Stored size: 591 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

26 entries across 26 versions & 1 rubygems

Version Path
tramway-event-1.12.6 app/forms/admin/tramway/event/participant_form.rb
tramway-event-1.12.5 app/forms/admin/tramway/event/participant_form.rb
tramway-event-1.12.4 app/forms/admin/tramway/event/participant_form.rb
tramway-event-1.12.3.10 app/forms/admin/tramway/event/participant_form.rb
tramway-event-1.12.3.9 app/forms/admin/tramway/event/participant_form.rb
tramway-event-1.12.3.8 app/forms/admin/tramway/event/participant_form.rb
tramway-event-1.12.3.7 app/forms/admin/tramway/event/participant_form.rb
tramway-event-1.12.3.6 app/forms/admin/tramway/event/participant_form.rb
tramway-event-1.12.3.5 app/forms/admin/tramway/event/participant_form.rb
tramway-event-1.12.3.4 app/forms/admin/tramway/event/participant_form.rb
tramway-event-1.12.3.3 app/forms/admin/tramway/event/participant_form.rb
tramway-event-1.12.3.2 app/forms/admin/tramway/event/participant_form.rb
tramway-event-1.12.3.1 app/forms/admin/tramway/event/participant_form.rb
tramway-event-1.12.3 app/forms/admin/tramway/event/participant_form.rb
tramway-event-1.12.2 app/forms/admin/tramway/event/participant_form.rb
tramway-event-1.12.1.1 app/forms/admin/tramway/event/participant_form.rb
tramway-event-1.12.1 app/forms/admin/tramway/event/participant_form.rb
tramway-event-1.12.0.1 app/forms/admin/tramway/event/participant_form.rb
tramway-event-1.12 app/forms/admin/tramway/event/participant_form.rb
tramway-event-1.11.5.1 app/forms/admin/tramway/event/participant_form.rb