diff --git a/app/controllers/items_controller.rb b/app/controllers/items_controller.rb index 519e096c..c352adac 100644 --- a/app/controllers/items_controller.rb +++ b/app/controllers/items_controller.rb @@ -23,7 +23,7 @@ class ItemsController < ApplicationController end end elsif params.has_key?(:ids) && params[:ids].is_a?(Array) - @items = Item.find(params[:ids]) + @items = Item.includes(:translations).find(params[:ids]) assign_closeted! respond_to do |format| format.json { render :json => @items } diff --git a/app/models/item/search/query.rb b/app/models/item/search/query.rb index 88f8bd80..37a73569 100644 --- a/app/models/item/search/query.rb +++ b/app/models/item/search/query.rb @@ -65,7 +65,9 @@ class Item end result = FlexSearch.item_search(final_flex_params) - result.loaded_collection + result.scoped_loaded_collection( + :scopes => {'Item' => Item.includes(:translations)} + ) end # Load the text query labels from I18n, so that when we see, say,