Class: Decidim::Admin::UpdateExternalDomainWhitelist

Inherits:
Command
  • Object
show all
Defined in:
decidim-admin/app/commands/decidim/admin/update_external_domain_whitelist.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Command

call, #evaluate, #method_missing, #respond_to_missing?, #transaction

Constructor Details

#initialize(form, organization) ⇒ UpdateExternalDomainWhitelist

Returns a new instance of UpdateExternalDomainWhitelist.


8
9
10
11
# File 'decidim-admin/app/commands/decidim/admin/update_external_domain_whitelist.rb', line 8

def initialize(form, organization)
  @form = form
  @organization = organization
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Decidim::Command

Instance Attribute Details

#formObject (readonly)

Returns the value of attribute form.


6
7
8
# File 'decidim-admin/app/commands/decidim/admin/update_external_domain_whitelist.rb', line 6

def form
  @form
end

#organizationObject (readonly)

Returns the value of attribute organization.


6
7
8
# File 'decidim-admin/app/commands/decidim/admin/update_external_domain_whitelist.rb', line 6

def organization
  @organization
end

Instance Method Details

#callObject


13
14
15
16
17
18
19
# File 'decidim-admin/app/commands/decidim/admin/update_external_domain_whitelist.rb', line 13

def call
  return broadcast(:invalid) if form.invalid?

  save_domains!

  broadcast(:ok)
end