ai tags: fix N+1 query issue.

This commit is contained in:
evazion
2022-06-27 02:37:49 -05:00
parent a2d8d19625
commit 6a08c57cec
3 changed files with 7 additions and 6 deletions

View File

@@ -10,7 +10,7 @@ class AITagsController < ApplicationController
params[:search][:is_posted] ||= "true" if request.format.html?
@ai_tags = authorize AITag.visible(CurrentUser.user).paginated_search(params, limit: limit, count_pages: false)
@ai_tags = @ai_tags.includes(:media_asset, :tag, :post) if request.format.html?
@ai_tags = @ai_tags.includes(:tag, media_asset: :post) if request.format.html?
respond_with(@ai_tags)
end