Product error handling
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user