Sha256: 672ef866ff5a9b593a338febb98eb5db61f174e6a3cebe0aa8b881789ce9e220
Contents?: true
Size: 847 Bytes
Versions: 18
Compression:
Stored size: 847 Bytes
Contents
# frozen_string_literal: true module Decidim module Proposals class NotifyProposalsMentionedJob < ApplicationJob def perform(comment_id, linked_proposals) comment = Decidim::Comments::Comment.find(comment_id) linked_proposals.each do |proposal_id| proposal = Proposal.find(proposal_id) affected_users = proposal.notifiable_identities - [comment.author] Decidim::EventsManager.publish( event: "decidim.events.proposals.proposal_mentioned", event_class: Decidim::Proposals::ProposalMentionedEvent, resource: comment.root_commentable, affected_users: affected_users, extra: { comment_id: comment.id, mentioned_proposal_id: proposal_id } ) end end end end end
Version data entries
18 entries across 18 versions & 1 rubygems