diff --git a/app/models/summary.rb b/app/models/summary.rb index d55f7aa..ed05dd5 100644 --- a/app/models/summary.rb +++ b/app/models/summary.rb @@ -2,7 +2,7 @@ class Summary def initialize(params = {}) @talk_id, @other_talk_ids = params[:talk_id], params[:other_talk_ids] @votes_count = SelectedTalk.where(talk_id: @talk_id).count - @all_votes_count = TalkPreference.joins(:selected_talks).where(selected_talks: {talk_id: @other_talk_ids << @talk_id}).count + @all_votes_count = TalkPreference.joins(:selected_talks).where(selected_talks: {talk_id: @other_talk_ids << @talk_id}).uniq.count end def summary