Sha256: 2daf22adc7390f60ac7f82aba6192f20e563c3e77cc0497c1ae71b70c93b202e

Contents?: true

Size: 670 Bytes

Versions: 5

Compression:

Stored size: 670 Bytes

Contents

# frozen_string_literal: true

class Tramway::Event::ParticipantExtendedFormCreator < Tramway::Core::FormCreator
  def self.create_form_class(uuid, event, **simple_properties)
    class_name = "ParticipantExtendedForm#{uuid.gsub('-', '')}"
    properties = event.participant_form_fields.inputs_list.reduce({}) do |hash, field|
      hash.merge! field.title.to_sym => { object: field, validates: field.options['validations'] }
    end
    if simple_properties.keys.any?
      ::Tramway::Core::ExtendableForm.new(class_name, simple_properties: simple_properties, **properties)
    else
      ::Tramway::Core::ExtendableForm.new(class_name, **properties)
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
tramway-event-1.9.19.6 app/forms/tramway/event/participant_extended_form_creator.rb
tramway-event-1.9.19.5 app/forms/tramway/event/participant_extended_form_creator.rb
tramway-event-1.9.19.4 app/forms/tramway/event/participant_extended_form_creator.rb
tramway-event-1.9.19.3 app/forms/tramway/event/participant_extended_form_creator.rb
tramway-event-1.9.19.2 app/forms/tramway/event/participant_extended_form_creator.rb