Configure rating scale as class instance variable of MajorityJudgment

This commit is contained in:
ricola 2025-04-06 17:04:31 -06:00
parent 9c2adb1072
commit 9810cdb615
4 changed files with 25 additions and 13 deletions

View file

@ -16,7 +16,7 @@
<td><%= user.email %></td>
<% @vote.candidates.each do |candidate| %>
<% if rating = @vote.ratings.find { |rating| rating.user == user and rating.candidate == candidate } %>
<td><%= rating.value %></td>
<td><%= settings.values.select { |e| e[:id] == rating.value }.first[:label] %></td>
<% end %>
<% end %>
</tr>
@ -27,7 +27,7 @@
<ol>
<% @vote.candidates.sort { |a, b| a.mj <=> b.mj }.reverse.each do |candidate| %>
<li><%= candidate.name %>: <%= candidate.mj.mj %></li>
<li><%= candidate.name %>: <%= settings.values.select { |e| e[:id] == candidate.mj.mj }.first[:label] %></li>
<% end %>
</ol>