progress and end of day commit
This commit is contained in:
@@ -92,6 +92,7 @@ class SuppliersController < ApplicationController
|
||||
format.json do
|
||||
products = @supplier.products
|
||||
products.include_relation(:product_categories)
|
||||
products.sort_by!{|p| p.product_category.try(:position) || 90000}
|
||||
h = products.inject({}){|h, p| n = p.product_category.try(:name) || 'other'; h[n] ||= []; h[n] << p; h}
|
||||
render json: h
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user