Working in progress app

This commit is contained in:
2015-10-07 16:23:49 +02:00
parent a4f6470d3d
commit b540f5945e
5 changed files with 42 additions and 1 deletions
+6
View File
@@ -69,6 +69,12 @@ class ProductCategory
product_categories
end
def active?(time = Time.now)
return true unless time_zone = supplier.time_zone.presence # cannot do activity magic without the appropriate time zone
true
end
def to_client_format
return {} unless products.present?
{name: name, products: products.to_a.map{|p| p.as_json}}