Fixed articles module.
This commit is contained in:
parent
f30e57dd49
commit
fc1c173718
14 changed files with 124 additions and 147 deletions
|
|
@ -15,7 +15,7 @@ class Article < ActiveRecord::Base
|
|||
scope :not_in_stock, :conditions => {:type => nil}
|
||||
|
||||
# Validations
|
||||
validates_presence_of :name, :unit, :price, :tax, :deposit, :unit_quantity, :supplier_id, :article_category_id
|
||||
validates_presence_of :name, :unit, :price, :tax, :deposit, :unit_quantity, :supplier_id, :article_category
|
||||
validates_length_of :name, :in => 4..60
|
||||
validates_length_of :unit, :in => 2..15
|
||||
validates_numericality_of :price, :unit_quantity, :greater_than => 0
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue