Expose the most and least number of conflicts
This commit is contained in:
parent
b9e6a89f22
commit
a8d05ea625
|
@ -1,2 +1,9 @@
|
|||
class ConflictsForTalk < ApplicationRecord
|
||||
def self.most
|
||||
first
|
||||
end
|
||||
|
||||
def self.least
|
||||
last
|
||||
end
|
||||
end
|
||||
|
|
|
@ -9,6 +9,14 @@ class Summary
|
|||
.uniq.count
|
||||
end
|
||||
|
||||
def most_conflicts
|
||||
ConflictsForTalk.where(talk_id: talk_ids).most.conflicts
|
||||
end
|
||||
|
||||
def least_conflicts
|
||||
ConflictsForTalk.where(talk_id: talk_ids).least.conflicts
|
||||
end
|
||||
|
||||
def ranking
|
||||
@ranking ||= Ranking.new(talk_ids: talk_ids).ranking
|
||||
end
|
||||
|
|
|
@ -1 +1 @@
|
|||
json.extract! @summary, :number_of_ballots, :ranking
|
||||
json.extract! @summary, :number_of_ballots, :most_conflicts, :least_conflicts, :ranking
|
||||
|
|
Loading…
Reference in New Issue