Eagerly load services in action to prevent n+1 query
This commit is contained in:
parent
da711dcfd4
commit
7d91c0349a
|
@ -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: } }
|
||||||
|
|
Loading…
Reference in New Issue