Sha256: de68d82a5bda4d1b4e17f2c88bdd82afb91611401163dc37530cbc762c917440

Contents?: true

Size: 540 Bytes

Versions: 1

Compression:

Stored size: 540 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,
      ).new object
    else
      super(object).tap do |obj|
        obj.form_properties event: :association
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
tramway-event-1.9.27.4 app/forms/tramway/event/participant_form.rb