Support creates follow (Merge pull request #3895)
* Supporting a proposal will create a follow relationship * Only followers receive notifications
This commit is contained in:
@@ -57,6 +57,7 @@ class ProposalsController < ApplicationController
|
||||
end
|
||||
|
||||
def vote
|
||||
@follow = Follow.find_or_create_by!(user: current_user, followable: @proposal)
|
||||
@proposal.register_vote(current_user, "yes")
|
||||
set_proposal_votes(@proposal)
|
||||
end
|
||||
@@ -73,6 +74,7 @@ class ProposalsController < ApplicationController
|
||||
end
|
||||
|
||||
def vote_featured
|
||||
@follow = Follow.find_or_create_by!(user: current_user, followable: @proposal)
|
||||
@proposal.register_vote(current_user, "yes")
|
||||
set_featured_proposal_votes(@proposal)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user