From e2b96b7a1e40e307daff020f94f5923000bba946 Mon Sep 17 00:00:00 2001 From: Pius Uzamere Date: Thu, 10 Dec 2009 19:32:46 -0500 Subject: [PATCH] don't recompute scores after the sort --- app/controllers/choices_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/choices_controller.rb b/app/controllers/choices_controller.rb index c49b188..e370119 100644 --- a/app/controllers/choices_controller.rb +++ b/app/controllers/choices_controller.rb @@ -9,11 +9,11 @@ class ChoicesController < InheritedResources::Base @question = Question.find(params[:question_id])#, :include => :choices) @question.reload @choices = Choice.find(:all, :conditions => {:question_id => @question.id, :active => true}, :limit => params[:limit].to_i, :order => 'score DESC') - @choices.each {|c| c.compute_score!} + #@choices.each {|c| c.compute_score!} else @question = Question.find(params[:question_id], :include => :choices) #eagerloads ALL choices @choices = @question.choices(true).active - @choices.each {|c| c.compute_score!} + #@choices.each {|c| c.compute_score!} end index! do |format| format.xml { render :xml => params[:data].blank? ? @choices.to_xml(:methods => [:item_data, :votes_count]) : @choices.to_xml(:include => [:items], :methods => [:data, :votes_count])} -- libgit2 0.21.2