Class: Admin::Tramway::Event::ParticipantForm

Inherits:
Tramway::Core::ApplicationForm
  • Object
show all
Defined in:
app/forms/admin/tramway/event/participant_form.rb

Class Method Summary collapse

Class Method Details

.new(object) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'app/forms/admin/tramway/event/participant_form.rb', line 9

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