Fixed bug in deliveries. Extended test fixtures.

This commit is contained in:
Benjamin Meichsner 2009-02-06 17:06:08 +01:00
parent 46d0a9c485
commit 0a87294ed4
9 changed files with 28 additions and 8 deletions

View file

@ -20,7 +20,7 @@
# order_number :string(255)
# created_at :datetime
# updated_at :datetime
# quantity :decimal(, ) default(0.0)
# quantity :integer default(0)
# deleted_at :datetime
# type :string(255)
#

View file

@ -21,7 +21,7 @@ class Delivery < ActiveRecord::Base
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?
stock_changes.build(attributes) unless attributes[:quantity].to_i == 0
end
end

View file

@ -20,7 +20,7 @@
# order_number :string(255)
# created_at :datetime
# updated_at :datetime
# quantity :decimal(, ) default(0.0)
# quantity :integer default(0)
# deleted_at :datetime
# type :string(255)
#

View file

@ -7,7 +7,7 @@
# delivery_id :integer
# order_id :integer
# stock_article_id :integer
# quantity :decimal(, ) default(0.0)
# quantity :integer default(0)
# created_at :datetime
#