Commit 08b60c1f4267da3c36872aada12d8ef0db401b55
1 parent
10acec7a
Exists in
master
and in
1 other branch
save before computing score
Showing
1 changed file
with
1 additions
and
0 deletions
Show diff stats
app/models/visitor.rb
... | ... | @@ -16,6 +16,7 @@ class Visitor < ActiveRecord::Base |
16 | 16 | choice = prompt.choices[ordinality] #we need to guarantee that the choices are in the right order (by position) |
17 | 17 | prompt_vote = votes.create!(:voteable => prompt) |
18 | 18 | choice_vote = votes.create!(:voteable => choice) |
19 | + choice.save! | |
19 | 20 | choice.score = choice.compute_score |
20 | 21 | choice.save! |
21 | 22 | end | ... | ... |