Fix all votes calculation
This commit is contained in:
parent
03dfaadb82
commit
59046a7b2b
|
@ -2,7 +2,7 @@ class Summary
|
||||||
def initialize(params = {})
|
def initialize(params = {})
|
||||||
@talk_id, @other_talk_ids = params[:talk_id], params[:other_talk_ids]
|
@talk_id, @other_talk_ids = params[:talk_id], params[:other_talk_ids]
|
||||||
@votes_count = SelectedTalk.where(talk_id: @talk_id).count
|
@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
|
end
|
||||||
|
|
||||||
def summary
|
def summary
|
||||||
|
|
Loading…
Reference in New Issue