Poll voter token
This commit is contained in:
@@ -17,9 +17,8 @@ class Poll::Answer < ActiveRecord::Base
|
||||
scope :by_question, ->(question_id) { where(question_id: question_id) }
|
||||
|
||||
def record_voter_participation(token)
|
||||
Poll::Voter.find_or_create_by!(user: author, poll: poll, origin: "web") do |poll_voter|
|
||||
poll_voter.token = token unless poll_voter.token.present?
|
||||
poll_voter.token_seen_at = Time.current unless poll_voter.token_seen_at.present?
|
||||
Poll::Voter.find_or_create_by(user: author, poll: poll, origin: "web") do |poll_voter|
|
||||
poll_voter.token = token unless poll_voter.token.present?
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user