Merge pull request 'Display affinity groups in arrangements show action' (#22) from display-affinity-groups-in-arrangements-show into main
All checks were successful
Run unit tests / unit_tests (push) Successful in 2m50s

Reviewed-on: #22
This commit is contained in:
bustikiller 2024-08-01 21:15:36 +00:00
commit eb759168a2
2 changed files with 4 additions and 2 deletions

View File

@ -5,6 +5,8 @@ class TablesArrangementsController < ApplicationController
def show
@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

View File

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