From 59303502838d31e754ad17a9648dd01e36b5b29b Mon Sep 17 00:00:00 2001 From: Manuel Bustillo Date: Thu, 1 Aug 2024 23:11:54 +0200 Subject: [PATCH] Display affinity groups in arrangements show action --- app/controllers/tables_arrangements_controller.rb | 4 +++- app/views/tables_arrangements/show.html.erb | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/controllers/tables_arrangements_controller.rb b/app/controllers/tables_arrangements_controller.rb index d2fd9ac..7d3c371 100644 --- a/app/controllers/tables_arrangements_controller.rb +++ b/app/controllers/tables_arrangements_controller.rb @@ -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 diff --git a/app/views/tables_arrangements/show.html.erb b/app/views/tables_arrangements/show.html.erb index f43b80d..a2b9aae 100644 --- a/app/views/tables_arrangements/show.html.erb +++ b/app/views/tables_arrangements/show.html.erb @@ -10,7 +10,7 @@ <% end %> \ No newline at end of file