adds notifications for proposals
This commit is contained in:
@@ -9,7 +9,7 @@ class NotificationsController < ApplicationController
|
||||
|
||||
def show
|
||||
@notification = current_user.notifications.find(params[:id])
|
||||
redirect_to url_for(@notification.notifiable)
|
||||
redirect_to url_for(@notification.linkable_resource)
|
||||
end
|
||||
|
||||
def mark_all_as_read
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user