Force distinct to recommendations methods. Sort by recommendations on home carousel.
This commit is contained in:
@@ -17,8 +17,8 @@ class WelcomeController < ApplicationController
|
||||
private
|
||||
|
||||
def set_user_recommendations
|
||||
@recommended_debates = Debate.recommendations(current_user).limit(3)
|
||||
@recommended_proposals = Proposal.recommendations(current_user).limit(3)
|
||||
@recommended_debates = Debate.recommendations(current_user).sort_by_recommendations.limit(3)
|
||||
@recommended_proposals = Proposal.recommendations(current_user).sort_by_recommendations.limit(3)
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -54,7 +54,7 @@ class Debate < ActiveRecord::Base
|
||||
debates_list = debates_list_with_tagged
|
||||
end
|
||||
|
||||
debates_list
|
||||
debates_list.uniq
|
||||
end
|
||||
|
||||
def searchable_values
|
||||
|
||||
@@ -65,7 +65,7 @@ class Proposal < ActiveRecord::Base
|
||||
proposals_list = self.proposals_not_followed_by_user(user, proposals_list_with_tagged)
|
||||
end
|
||||
|
||||
proposals_list
|
||||
proposals_list.uniq
|
||||
end
|
||||
|
||||
def self.proposals_with_tagged(user, proposals_list)
|
||||
|
||||
Reference in New Issue
Block a user