Eagerly load services in action to prevent n+1 query

This commit is contained in:
Andreas Nedbal 2023-02-02 00:44:42 +01:00
parent da711dcfd4
commit 7d91c0349a
1 changed files with 1 additions and 1 deletions

View File

@ -18,7 +18,7 @@ class InboxController < ApplicationController
@delete_id = find_delete_id @delete_id = find_delete_id
@disabled = true if @inbox.empty? @disabled = true if @inbox.empty?
services = current_user.services services = current_user.services.to_a
respond_to do |format| respond_to do |format|
format.html { render "show", locals: { services: } } format.html { render "show", locals: { services: } }