adds notifications for proposals

This commit is contained in:
rgarcia
2016-06-07 22:03:14 +02:00
parent ea90869114
commit a0ddde16e9
8 changed files with 95 additions and 4 deletions

View File

@@ -11,6 +11,7 @@ class ProposalNotificationsController < ApplicationController
@proposal = Proposal.find(notification_params[:proposal_id])
if @notification.save
@proposal.voters.each do |voter|
Notification.add(voter.id, @notification)
if voter.email_on_proposal_notification?
Mailer.proposal_notification(@notification, voter).deliver_later
end