progress and end of day commit

This commit is contained in:
2012-08-22 21:58:20 +02:00
parent 0856528f5e
commit 13dd2bf335
11 changed files with 95 additions and 16 deletions
+1
View File
@@ -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