Refactor for authorization sanity

This commit is contained in:
2015-02-19 16:29:17 +01:00
parent a1474e934a
commit 5b3c1a9007
22 changed files with 190 additions and 80 deletions
@@ -27,5 +27,19 @@ module Suppliers
format.json { render json: @order }
end
end
# POST /orders/1/mark_in_process
def mark_in_process
@order = Order.find_by_supplier_id_and_id!(current_supplier.id, params[:id])
@order.is_being_processed!
head :ok
end
# POST /orders/1/is_delivered
def mark_delivered
@order = Order.find_by_supplier_id_and_id(current_supplier.id, params[:id])
@order.is_delivered!
render nothing: true
end
end
end