Skip to content

Commit

Permalink
Validate presence of variant on StockItem
Browse files Browse the repository at this point in the history
  • Loading branch information
GeekOnCoffee authored and BDQ committed Apr 2, 2013
1 parent 556cf76 commit 7a589db
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/app/models/spree/stock_item.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ class StockItem < ActiveRecord::Base
belongs_to :variant
has_many :stock_movements, dependent: :destroy

validates_presence_of :stock_location
validates_presence_of :stock_location, :variant
validates_uniqueness_of :variant_id, scope: :stock_location_id

attr_accessible :count_on_hand, :variant, :stock_location, :backorderable, :variant_id
Expand Down

0 comments on commit 7a589db

Please sign in to comment.