Product error handling

This commit is contained in:
2014-11-27 14:48:33 +01:00
parent 60f014811c
commit 5453837880
20 changed files with 96 additions and 39 deletions
+1 -1
View File
@@ -19,7 +19,7 @@ class Product
validates :name, presence: true
validates :supplier_id, presence: true
validates :price, presence: true, numericality: true
validates :price, numericality: {greater_than: 0}
view :by_supplier_id_and_id, key: [:supplier_id, :_id]
#after_save :persist_product_category_ids