Class: Decidim::Assemblies::Admin::AssemblyMemberForm
- Inherits:
-
Form
- Object
- Form
- Decidim::Assemblies::Admin::AssemblyMemberForm
- Defined in:
- app/forms/decidim/assemblies/admin/assembly_member_form.rb
Overview
A form object used to create assembly members from the admin dashboard.
Instance Method Summary collapse
Instance Method Details
#map_model(model) ⇒ Object
44 45 46 47 |
# File 'app/forms/decidim/assemblies/admin/assembly_member_form.rb', line 44 def map_model(model) self.user_id = model.decidim_user_id self.existing_user = user_id.present? end |
#positions_for_select ⇒ Object
53 54 55 56 57 58 59 60 |
# File 'app/forms/decidim/assemblies/admin/assembly_member_form.rb', line 53 def positions_for_select Decidim::AssemblyMember::POSITIONS.map do |position| [ I18n.t(position, scope: "decidim.admin.models.assembly_member.positions"), position ] end end |
#user ⇒ Object
49 50 51 |
# File 'app/forms/decidim/assemblies/admin/assembly_member_form.rb', line 49 def user @user ||= current_organization.user_entities.find_by(id: user_id) end |