Since there are StockArticles for each supplier, the StockArticles has

to be excluded in normal articles-view.
This commit is contained in:
Benjamin Meichsner 2009-02-07 15:19:07 +01:00
parent 24b66ee8d4
commit 4d796b8e73
3 changed files with 5 additions and 4 deletions

View file

@ -35,6 +35,7 @@ class Article < ActiveRecord::Base
has_many :article_prices, :order => "created_at"
named_scope :available, :conditions => {:availability => true}
named_scope :not_in_stock, :conditions => {:type => nil}
# Validations
validates_presence_of :name, :unit, :price, :tax, :deposit, :unit_quantity, :supplier_id, :article_category_id