Sha256: 88276e0eebfc01c72e6c8014cd8842c2d0024758edb1a8e39fda06d168ca73da

Contents?: true

Size: 540 Bytes

Versions: 48

Compression:

Stored size: 540 Bytes

Contents

require 'securerandom'

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

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

Version data entries

48 entries across 48 versions & 1 rubygems

Version Path
tramway-event-1.9.19.1 app/forms/tramway/event/participant_form.rb
tramway-event-1.9.19 app/forms/tramway/event/participant_form.rb
tramway-event-1.9.18.2 app/forms/tramway/event/participant_form.rb
tramway-event-1.9.18.1 app/forms/tramway/event/participant_form.rb
tramway-event-1.9.18 app/forms/tramway/event/participant_form.rb
tramway-event-1.9.17 app/forms/tramway/event/participant_form.rb
tramway-event-1.9.16 app/forms/tramway/event/participant_form.rb
tramway-event-1.9.15 app/forms/tramway/event/participant_form.rb
tramway-event-1.9.14 app/forms/tramway/event/participant_form.rb
tramway-event-1.9.13 app/forms/tramway/event/participant_form.rb
tramway-event-1.9.12 app/forms/tramway/event/participant_form.rb
tramway-event-1.9.11.2 app/forms/tramway/event/participant_form.rb
tramway-event-1.9.11.1 app/forms/tramway/event/participant_form.rb
tramway-event-1.9.11 app/forms/tramway/event/participant_form.rb
tramway-event-1.9.10.1 app/forms/tramway/event/participant_form.rb
tramway-event-1.9.10 app/forms/tramway/event/participant_form.rb
tramway-event-1.9.9.2 app/forms/tramway/event/participant_form.rb
tramway-event-1.9.9.1 app/forms/tramway/event/participant_form.rb
tramway-event-1.9.9 app/forms/tramway/event/participant_form.rb
tramway-event-1.9.8 app/forms/tramway/event/participant_form.rb