Class: Decidim::InviteUserForm
- Defined in:
- app/forms/decidim/invite_user_form.rb
Overview
A form object used to invite users to an organization.
Instance Method Summary collapse
Instance Method Details
#available_roles_for_select ⇒ Object
34 35 36 37 38 39 40 41 |
# File 'app/forms/decidim/invite_user_form.rb', line 34 def available_roles_for_select Decidim::User::Roles.all.map do |role| [ I18n.t("models.user.fields.roles.#{role}", scope: "decidim.admin"), role ] end end |
#email ⇒ Object
22 23 24 |
# File 'app/forms/decidim/invite_user_form.rb', line 22 def email super&.downcase end |
#invited_by ⇒ Object
30 31 32 |
# File 'app/forms/decidim/invite_user_form.rb', line 30 def invited_by super || current_user end |
#organization ⇒ Object
26 27 28 |
# File 'app/forms/decidim/invite_user_form.rb', line 26 def organization super || current_organization end |