From a8dd3ca04013c906c78bcd34ad61c3425a3fafcf Mon Sep 17 00:00:00 2001 From: Petko Bordjukov Date: Thu, 13 Oct 2016 08:12:22 +0300 Subject: [PATCH] Add conflicts summary to voting summary --- app/models/summary.rb | 4 ++++ app/views/summaries/show.json.jbuilder | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/models/summary.rb b/app/models/summary.rb index 65fc8b3..a524e53 100644 --- a/app/models/summary.rb +++ b/app/models/summary.rb @@ -25,6 +25,10 @@ class Summary @ranking ||= Ranking.new(talk_ids: talk_ids).ranking end + def conflicts + @conflicts ||= ConflictsSummary.new(talk_ids: talk_ids).conflicts + end + private def least_conflicts_for_single_talk diff --git a/app/views/summaries/show.json.jbuilder b/app/views/summaries/show.json.jbuilder index 6f5ae26..9990e5d 100644 --- a/app/views/summaries/show.json.jbuilder +++ b/app/views/summaries/show.json.jbuilder @@ -1 +1 @@ -json.extract! @summary, :number_of_ballots, :most_conflicts, :least_conflicts, :ranking +json.extract! @summary, :number_of_ballots, :most_conflicts, :least_conflicts, :ranking, :conflicts