diff --git a/app/controllers/supplier_controller.rb b/app/controllers/supplier_controller.rb index f1578f1f..b3e0269a 100644 --- a/app/controllers/supplier_controller.rb +++ b/app/controllers/supplier_controller.rb @@ -98,7 +98,7 @@ class SupplierController < ApplicationController # POST /orders/1/is_being_processed def mark_order_in_process - @order = Order.find_by_supplier_id_and_id(current_supplier.id, params[:order_id]) + @order = Order.find_by_supplier_id_and_id!(current_supplier.id, params[:order_id]) @order.is_being_processed! render nothing: true end diff --git a/app/models/order.rb b/app/models/order.rb index 7d4ae69e..8f3e86cf 100644 --- a/app/models/order.rb +++ b/app/models/order.rb @@ -25,7 +25,7 @@ class Order } }], reduce_function: '_sum' - #view :by_supplier_id_and_id, key: [:supplier_id, :_id] + view :by_supplier_id_and_id, key: [:supplier_id, :_id] # Do not comment me out # Return all currently active orders for a given supplier def self.active_for_supplier(supplier_id) diff --git a/app/views/suppliers/products/index.html.slim b/app/views/suppliers/products/index.html.slim index 0d3a861b..171c3788 100644 --- a/app/views/suppliers/products/index.html.slim +++ b/app/views/suppliers/products/index.html.slim @@ -53,7 +53,7 @@ script#products-category-template[type="text/html"]= mustache_template 'user/pro products: category.products, include_order_buttons: false } - result_html = Mustache.to_html($('#products-category-template').html(), obj) + result_html = Handlebars.compile($('#products-category-template').html())(obj) body.append(result_html) } })