Class: Decidim::Proposals::Admin::UpdateProposalTaxonomies

Inherits:
UpdateResourcesTaxonomies
  • Object
show all
Includes:
TranslatableAttributes
Defined in:
app/commands/decidim/proposals/admin/update_proposal_taxonomies.rb

Overview

A command with all the business logic when an admin batch updates proposals taxonomies.

Instance Method Summary collapse

Constructor Details

#initialize(taxonomy_ids, proposal_ids, organization) ⇒ UpdateProposalTaxonomies

Public: Initializes the command.

taxonomy_ids - the taxonomy ids to update proposal_ids - the proposals ids to update.



13
14
15
# File 'app/commands/decidim/proposals/admin/update_proposal_taxonomies.rb', line 13

def initialize(taxonomy_ids, proposal_ids, organization)
  super(taxonomy_ids, Decidim::Proposals::Proposal.where(id: proposal_ids), organization)
end

Instance Method Details

#run_after_hooks(resource) ⇒ Object



17
18
19
# File 'app/commands/decidim/proposals/admin/update_proposal_taxonomies.rb', line 17

def run_after_hooks(resource)
  notify_author(resource) if resource.coauthorships.any?
end