Fix new stock article failing

This commit is contained in:
wvengen 2016-05-20 21:30:56 +02:00
parent f9ffa0caff
commit be287cf67e
2 changed files with 20 additions and 21 deletions

View file

@ -5,6 +5,8 @@ class StockArticle < Article
scope :available, -> { undeleted.where('quantity > 0') }
validates :quantity, presence: true, numericality: {greater_than_or_equal_to: 0}
before_destroy :check_quantity
# Update the quantity of items in stock
@ -46,4 +48,3 @@ class StockArticle < Article
true
end
end