End of evening commit, changing supplier to JSONAPI

This commit is contained in:
2015-09-08 23:22:13 +02:00
parent 3cb7fd2a6f
commit 9c1945252d
36 changed files with 195 additions and 230 deletions
@@ -6,13 +6,13 @@ module Suppliers
def show
[current_supplier].include_relations(sections: :tables, product_categories: {products: :product_variants})
render json: current_supplier, serializer: Suppliers::SupplierSerializer #.new(current_supplier).as_json
render json: JSONAPI::Serializer.serialize(current_supplier, serializer: Suppliers::SupplierSerializer) #.new(current_supplier).as_json
end
def update
@supplier = current_supplier
current_supplier.update_attributes(supplier_params)
render json: Suppliers::SupplierSerializer.new(current_supplier).as_json
render json: JSONAPI::Serializer.serialize( current_supplier, serializer: Suppliers::SupplierSerializer)
end
def switch_to