From 709425855e09f9cf0b8370407f3d30925a1a430d Mon Sep 17 00:00:00 2001 From: Benjamin Meichsner Date: Tue, 21 Jul 2009 15:09:55 +0200 Subject: [PATCH] Added validation for unit_quantity and localization for article attributes. --- app/models/article.rb | 2 +- config/locales/de.yml | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/models/article.rb b/app/models/article.rb index b12288b2..92fb1f86 100644 --- a/app/models/article.rb +++ b/app/models/article.rb @@ -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 diff --git a/config/locales/de.yml b/config/locales/de.yml index d88b83dc..9466a80e 100644 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -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: