Commit c3e259d6424b39421abf612478fb71cc021c7f29
1 parent
e815ffbe
Exists in
master
and in
1 other branch
recompute score before returning results
Showing
2 changed files
with
6 additions
and
0 deletions
Show diff stats
app/controllers/choices_controller.rb
... | ... | @@ -5,6 +5,7 @@ class ChoicesController < InheritedResources::Base |
5 | 5 | has_scope :active, :boolean => true, :only => :index |
6 | 6 | |
7 | 7 | def index |
8 | + Choice.all.each {|c| c.compute_score!} | |
8 | 9 | if params[:limit] |
9 | 10 | @question = Question.find(params[:question_id])#, :include => :choices) |
10 | 11 | @question.reload | ... | ... |