Commit 34e972bd8fed417d72200b6e45cbae8e0193d2cf

Authored by Pius Uzamere
1 parent 251cd4de

recompute the choice score before it gets shown

Showing 1 changed file with 3 additions and 1 deletions   Show diff stats
app/controllers/choices_controller.rb
... ... @@ -24,7 +24,9 @@ class ChoicesController < InheritedResources::Base
24 24  
25 25 def show
26 26 show! do |format|
27   - format.xml { render :xml => @choice.to_xml(:methods => [:item_data, :wins_plus_losses])}
  27 + format.xml {
  28 + @choice.compute_score!
  29 + render :xml => @choice.to_xml(:methods => [:item_data, :wins_plus_losses])}
28 30 format.json { render :json => @choice.to_json(:methods => [:data])}
29 31 end
30 32 end
... ...