Sha256: 8e8926bbbe39beefc214419f260e08127fd85e42544e4034a8556ca11b1c3a35

Contents?: true

Size: 518 Bytes

Versions: 9

Compression:

Stored size: 518 Bytes

Contents

# frozen_string_literal: true

require 'securerandom'

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

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

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
tramway-event-1.12.9.1 app/forms/admin/tramway/event/participant_form.rb
tramway-event-1.12.9 app/forms/admin/tramway/event/participant_form.rb
tramway-event-1.12.8.2 app/forms/admin/tramway/event/participant_form.rb
tramway-event-1.12.8.1 app/forms/admin/tramway/event/participant_form.rb
tramway-event-1.12.8 app/forms/admin/tramway/event/participant_form.rb
tramway-event-1.12.7 app/forms/admin/tramway/event/participant_form.rb
tramway-event-1.12.6.4 app/forms/admin/tramway/event/participant_form.rb
tramway-event-1.12.6.3 app/forms/admin/tramway/event/participant_form.rb
tramway-event-1.12.6.2 app/forms/admin/tramway/event/participant_form.rb