Class: Decidim::InviteUserForm

Inherits:
Form
  • Object
show all
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_selectObject



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

#emailObject



22
23
24
# File 'app/forms/decidim/invite_user_form.rb', line 22

def email
  super&.downcase
end

#invited_byObject



30
31
32
# File 'app/forms/decidim/invite_user_form.rb', line 30

def invited_by
  super || current_user
end

#organizationObject



26
27
28
# File 'app/forms/decidim/invite_user_form.rb', line 26

def organization
  super || current_organization
end