Sha256: 49657ee460d89af4efd78d9b5d02f3ba3cf850ed25e3d44a74d4732fed88660c

Contents?: true

Size: 408 Bytes

Versions: 7

Compression:

Stored size: 408 Bytes

Contents

require 'securerandom'

class Tramway::Event::ParticipantForm < ::Tramway::Core::ApplicationForm
  association :event

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

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
tramway-event-1.5.4 app/forms/tramway/event/participant_form.rb
tramway-event-1.5.3 app/forms/tramway/event/participant_form.rb
tramway-event-1.5.2 app/forms/tramway/event/participant_form.rb
tramway-event-1.5.1 app/forms/tramway/event/participant_form.rb
tramway-event-1.5 app/forms/tramway/event/participant_form.rb
tramway-event-1.4 app/forms/tramway/event/participant_form.rb
tramway-event-1.3 app/forms/tramway/event/participant_form.rb