Allow voting on open votes only
This commit is contained in:
parent
0afc881b5d
commit
cac94c2379
1 changed files with 1 additions and 0 deletions
1
vedia.rb
1
vedia.rb
|
|
@ -306,6 +306,7 @@ end
|
|||
post '/votes/:id/ratings' do
|
||||
require_login
|
||||
find_vote
|
||||
require_open_vote
|
||||
@vote.candidates.each do |candidate|
|
||||
rating = Rating.find_or_initialize_by(vote: @vote, user: current_user, candidate: candidate)
|
||||
rating.value = params[candidate.id.to_s]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue