Class: Decidim::Admin::UpdateExternalDomainAllowlist
- Inherits:
-
Command
- Object
- Command
- Decidim::Admin::UpdateExternalDomainAllowlist
- Defined in:
- app/commands/decidim/admin/update_external_domain_allowlist.rb
Instance Attribute Summary collapse
-
#form ⇒ Object
readonly
Returns the value of attribute form.
-
#organization ⇒ Object
readonly
Returns the value of attribute organization.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(form, organization) ⇒ UpdateExternalDomainAllowlist
constructor
A new instance of UpdateExternalDomainAllowlist.
Constructor Details
#initialize(form, organization) ⇒ UpdateExternalDomainAllowlist
Returns a new instance of UpdateExternalDomainAllowlist.
10 11 12 13 |
# File 'app/commands/decidim/admin/update_external_domain_allowlist.rb', line 10 def initialize(form, organization) @form = form @organization = organization end |
Instance Attribute Details
#form ⇒ Object (readonly)
Returns the value of attribute form.
6 7 8 |
# File 'app/commands/decidim/admin/update_external_domain_allowlist.rb', line 6 def form @form end |
#organization ⇒ Object (readonly)
Returns the value of attribute organization.
6 7 8 |
# File 'app/commands/decidim/admin/update_external_domain_allowlist.rb', line 6 def organization @organization end |
Instance Method Details
#call ⇒ Object
15 16 17 18 19 20 21 22 23 |
# File 'app/commands/decidim/admin/update_external_domain_allowlist.rb', line 15 def call return broadcast(:invalid) if form.invalid? Decidim.traceability.perform_action!("update_external_domain", @organization, current_user) do save_domains! end broadcast(:ok) end |