refactors voted debates

This commit is contained in:
rgarcia
2015-08-15 14:57:41 +02:00
parent 4751954377
commit 9f2d60c4ce
7 changed files with 73 additions and 24 deletions

View File

@@ -2,8 +2,8 @@ class WelcomeController < ApplicationController
skip_authorization_check
def index
@featured_debates = Debate.order("created_at DESC").limit(9)
set_voted_values @featured_debates.map(&:id)
@featured_debates = Debate.limit(9)
set_debate_votes(@featured_debates)
end
end