Class: Decidim::Admin::UpdateExternalDomainWhitelist

Inherits:
Rectify::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

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

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