app/forms/tramway/event/participant_form.rb in tramway-event-1.2.6 vs app/forms/tramway/event/participant_form.rb in tramway-event-1.3

- old
+ new

@@ -1,9 +1,15 @@ +require 'securerandom' + class Tramway::Event::ParticipantForm < ::Tramway::Core::ApplicationForm - properties :event_id, :values + association :event - def initialize(object, event) - form_object = super object - form_properties event_id: :default - form_object + 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