Commit e2b96b7a1e40e307daff020f94f5923000bba946

Authored by Pius Uzamere
1 parent e3d3ff1c

don't recompute scores after the sort

Showing 1 changed file with 2 additions and 2 deletions   Show diff stats
app/controllers/choices_controller.rb
... ... @@ -9,11 +9,11 @@ class ChoicesController < InheritedResources::Base
9 9 @question = Question.find(params[:question_id])#, :include => :choices)
10 10 @question.reload
11 11 @choices = Choice.find(:all, :conditions => {:question_id => @question.id, :active => true}, :limit => params[:limit].to_i, :order => 'score DESC')
12   - @choices.each {|c| c.compute_score!}
  12 + #@choices.each {|c| c.compute_score!}
13 13 else
14 14 @question = Question.find(params[:question_id], :include => :choices) #eagerloads ALL choices
15 15 @choices = @question.choices(true).active
16   - @choices.each {|c| c.compute_score!}
  16 + #@choices.each {|c| c.compute_score!}
17 17 end
18 18 index! do |format|
19 19 format.xml { render :xml => params[:data].blank? ? @choices.to_xml(:methods => [:item_data, :votes_count]) : @choices.to_xml(:include => [:items], :methods => [:data, :votes_count])}
... ...