Added validation for unit_quantity and localization for article attributes.

This commit is contained in:
Benjamin Meichsner 2009-07-21 15:09:55 +02:00
parent ecc1176020
commit 709425855e
2 changed files with 5 additions and 1 deletions

View File

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

View File

@ -127,6 +127,10 @@ de:
article:
price: Nettopreis
gross_price: Bruttopreis
unit: Einheit
unit_quantity: Gebindegröße
tax: MwSt
deposit: Pfand
stock_article:
price: Nettopreis
user: