Class: Decidim::Admin::ManagedUserForm
- Inherits:
-
Form
- Object
- Form
- Decidim::Admin::ManagedUserForm
- Defined in:
- app/forms/decidim/admin/managed_user_form.rb
Overview
A form object used to create managed users from the admin dashboard.
This form will contain a dynamic attribute for the user authorization. This authorization will be selected by the admin user if more than one exists.
Instance Method Summary collapse
-
#initialize(attributes) ⇒ ManagedUserForm
constructor
A new instance of ManagedUserForm.
Constructor Details
#initialize(attributes) ⇒ ManagedUserForm
Returns a new instance of ManagedUserForm.
15 16 17 18 19 20 21 22 |
# File 'app/forms/decidim/admin/managed_user_form.rb', line 15 def initialize(attributes) extend(Virtus.model) # Set the authorization dynamic attribute as a nested form class based on the handler name. attribute(:authorization, attributes.dig(:authorization, :handler_name).classify.constantize) super end |