Introduced StockChange. Implemented first part of stockit-logic with updating article's quantity.

This commit is contained in:
Benjamin Meichsner 2009-01-16 02:17:49 +01:00
parent 7ff0467b16
commit b38025869a
27 changed files with 233 additions and 123 deletions

View file

@ -12,6 +12,14 @@
class Delivery < ActiveRecord::Base
belongs_to :supplier
has_many :stock_changes
validates_presence_of :supplier_id
def stock_change_attributes=(stock_change_attributes)
for attributes in stock_change_attributes
stock_changes.build(attributes) unless attributes[:quantity] == 0.0 or attributes[:quantity].blank?
end
end
end