Added validation for unit_quantity and localization for article attributes.
This commit is contained in:
parent
ecc1176020
commit
709425855e
2 changed files with 5 additions and 1 deletions
|
|
@ -41,7 +41,7 @@ class Article < ActiveRecord::Base
|
|||
validates_presence_of :name, :unit, :price, :tax, :deposit, :unit_quantity, :supplier_id, :article_category_id
|
||||
validates_length_of :name, :in => 4..60
|
||||
validates_length_of :unit, :in => 2..15
|
||||
validates_numericality_of :price, :greater_than => 0
|
||||
validates_numericality_of :price, :unit_quantity, :greater_than => 0
|
||||
validates_numericality_of :deposit, :tax
|
||||
|
||||
# Callbacks
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue