Fixed articles module.

This commit is contained in:
benni 2012-10-28 18:03:50 +01:00
parent f30e57dd49
commit fc1c173718
14 changed files with 124 additions and 147 deletions

View file

@ -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