6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
# File 'app/jobs/decidim/proposals/notify_proposals_mentioned_job.rb', line 6
def perform(, linked_proposals)
= Decidim::Comments::Comment.find()
linked_proposals.each do |proposal_id|
proposal = Proposal.find(proposal_id)
affected_users = proposal.notifiable_identities - [.author]
Decidim::EventsManager.publish(
event: "decidim.events.proposals.proposal_mentioned",
event_class: Decidim::Proposals::ProposalMentionedEvent,
resource: .,
affected_users:,
extra: {
comment_id: .id,
mentioned_proposal_id: proposal_id
}
)
end
end
|