This commit is contained in:
Julius 2013-02-25 10:29:47 +01:00
parent 8f15cfb446
commit 5dc3fc30ad
12 changed files with 33 additions and 215 deletions

View file

@ -1,24 +0,0 @@
# encoding: utf-8
class StockArticleSelection < ActiveRecord::Base
# Associations
has_and_belongs_to_many :stock_articles
belongs_to :created_by, :class_name => 'User', :foreign_key => 'created_by_user_id'
belongs_to :finished_by, :class_name => 'User', :foreign_key => 'finished_by_user_id'
# Validations
validate :include_stock_articles
def all_articles
all_articles = stock_article_ids
end
protected
def include_stock_articles
errors.add(:stock_articles, "Es muss mindestens ein Lagerartikel ausgewählt sein.") if stock_articles.empty?
end
private
end