New proposal method to get users_to_notify.
This commit is contained in:
committed by
Senén Rodero Rodríguez
parent
0c2be6a0d4
commit
5fe894aa6b
@@ -11,7 +11,7 @@ class ProposalNotificationsController < ApplicationController
|
||||
@notification = ProposalNotification.new(proposal_notification_params)
|
||||
@proposal = Proposal.find(proposal_notification_params[:proposal_id])
|
||||
if @notification.save
|
||||
notification_users.each do |user|
|
||||
@proposal.users_to_notify.each do |user|
|
||||
Notification.add(user.id, @notification)
|
||||
end
|
||||
redirect_to @notification, notice: I18n.t("flash.actions.create.proposal_notification")
|
||||
@@ -30,8 +30,4 @@ class ProposalNotificationsController < ApplicationController
|
||||
params.require(:proposal_notification).permit(:title, :body, :proposal_id)
|
||||
end
|
||||
|
||||
def notification_users
|
||||
(@proposal.voters + @proposal.followers).uniq
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user