Sha256: d00e3c73ed24f9c392356ce97e6a850b147cc78b58e2866f7b6ef838d2f26b14
Contents?: true
Size: 1.03 KB
Versions: 88
Compression:
Stored size: 1.03 KB
Contents
# frozen_string_literal: true module Decidim module Initiatives # Service that notifies progress for an initiative class ProgressNotifier attr_reader :initiative def initialize(args = {}) @initiative = args.fetch(:initiative) end # PUBLIC: Notifies the support progress of the initiative. # # Notifies to Initiative's authors and followers about the # number of supports received by the initiative. def notify initiative.followers.each do |follower| Decidim::Initiatives::InitiativesMailer .notify_progress(initiative, follower) .deliver_later end initiative.committee_members.approved.each do |committee_member| Decidim::Initiatives::InitiativesMailer .notify_progress(initiative, committee_member.user) .deliver_later end Decidim::Initiatives::InitiativesMailer .notify_progress(initiative, initiative.author) .deliver_later end end end end
Version data entries
88 entries across 88 versions & 1 rubygems