Display affinity groups in arrangements show action
All checks were successful
Run unit tests / unit_tests (pull_request) Successful in 3m27s

This commit is contained in:
Manuel Bustillo 2024-08-01 23:11:54 +02:00
parent c161b1f7c1
commit 5930350283
2 changed files with 4 additions and 2 deletions

View File

@ -5,6 +5,8 @@ class TablesArrangementsController < ApplicationController
def show def show
@tables_arrangement = TablesArrangement.find(params[:id]) @tables_arrangement = TablesArrangement.find(params[:id])
@seats = @tables_arrangement.seats.includes(:guest).group_by(&:table_number) @seats = @tables_arrangement.seats
.includes(guest: %i[affinity_groups unbreakable_bonds])
.group_by(&:table_number)
end end
end end

View File

@ -10,7 +10,7 @@
<ul> <ul>
<% seats.each do |seat| %> <% seats.each do |seat| %>
<li><%= seat.guest.full_name %></li> <li><%= seat.guest.full_name %> (<%= seat.guest.affinity_groups.pluck(:name).join(", ") %>)</li>
<% end %> <% end %>
</ul> </ul>
<% end %> <% end %>