JSONApi progress

This commit is contained in:
2015-09-03 20:42:48 +02:00
parent f47a8a9ed0
commit e4dde28dd0
27 changed files with 215 additions and 64 deletions
+1 -1
View File
@@ -8,7 +8,7 @@ module Users
@list = List.find(params[:list_id])
render json: {}, status: :not_found and return unless @list.present? && Array.wrap(@list.user_ids).include?(current_user.id)
orders = @list.orders.include_relation(:product_orders)
render json: orders, each_serializer: Users::OrderSerializer, include: %w[product_orders]
render json: JSONAPI::Serializer.serialize(orders, serializer: Users::OrderSerializer, include: %w[product_orders product_orders.order], is_collection: true)
end
# Used by the user Ember app