Class: Decidim::Admin::SelectiveNewsletterForm

Inherits:
Form
  • Object
show all
Defined in:
app/forms/decidim/admin/selective_newsletter_form.rb

Overview

A form object to select which users will be sent the selective newsletters

Instance Method Summary collapse

Instance Method Details

#map_model(_newsletter) ⇒ Object



21
22
23
24
25
# File 'app/forms/decidim/admin/selective_newsletter_form.rb', line 21

def map_model()
  self.participatory_space_types = Decidim.participatory_space_manifests.map do |manifest|
    SelectiveNewsletterParticipatorySpaceTypeForm.from_model(manifest: manifest)
  end
end

#scope_idsObject

Make sure the empty scope is not passed because then some logic could assume erroneously that some scope is selected.



29
30
31
# File 'app/forms/decidim/admin/selective_newsletter_form.rb', line 29

def scope_ids
  super.select(&:presence)
end