Class: Decidim::Conferences::Admin::ConferenceRegistrationInviteForm

Inherits:
Form show all
Includes:
TranslatableAttributes
Defined in:
decidim-conferences/app/forms/decidim/conferences/admin/conference_registration_invite_form.rb

Overview

A form object used to invite users to join a conference.

Constant Summary

Constants included from AttributeObject::TypeMap

AttributeObject::TypeMap::Boolean, AttributeObject::TypeMap::Decimal

Instance Attribute Summary

Attributes inherited from AttributeObject::Form

#context

Instance Method Summary collapse

Methods included from TranslatableAttributes

#default_locale?

Methods inherited from AttributeObject::Form

ensure_hash, from_model, from_params, hash_from, infer_model_name, #map_model, mimic, mimicked_model_name, model_name, #persisted?, #to_key, #to_model, #to_param, #valid?, #with_context

Methods included from AttributeObject::Model

#[], #[]=, #attributes, #attributes_with_values, #initialize, #to_h

Instance Method Details

#registration_typeObject


24
25
26
# File 'decidim-conferences/app/forms/decidim/conferences/admin/conference_registration_invite_form.rb', line 24

def registration_type
  @registration_type ||= current_participatory_space.registration_types.find_by(id: registration_type_id)
end

#registration_types_for_selectObject


28
29
30
31
32
33
34
35
# File 'decidim-conferences/app/forms/decidim/conferences/admin/conference_registration_invite_form.rb', line 28

def registration_types_for_select
  @registration_types_for_select ||= current_participatory_space.registration_types&.map do |registration_type|
    [
      translated_attribute(registration_type.title),
      registration_type.id
    ]
  end
end

#userObject


20
21
22
# File 'decidim-conferences/app/forms/decidim/conferences/admin/conference_registration_invite_form.rb', line 20

def user
  @user ||= current_organization.users.find_by(id: user_id)
end