use item proxies in items#index when given item IDs
This commit is contained in:
parent
5b9394ce82
commit
b92131b26c
1 changed files with 2 additions and 1 deletions
|
@ -33,8 +33,9 @@ class ItemsController < ApplicationController
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
elsif params.has_key?(:ids) && params[:ids].is_a?(Array)
|
elsif params.has_key?(:ids) && params[:ids].is_a?(Array)
|
||||||
@items = Item.includes(:translations).find(params[:ids])
|
@items = Item.build_proxies(params[:ids])
|
||||||
assign_closeted!
|
assign_closeted!
|
||||||
|
@items.prepare_method(:as_json)
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.json { render json: @items }
|
format.json { render json: @items }
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue