mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Ignore Rails/UniqueValidationWithoutIndex for unique index of StockItem#stock_location
This commit is contained in:
@@ -7,7 +7,9 @@ module Spree
|
||||
has_many :stock_movements, dependent: :destroy
|
||||
|
||||
validates :stock_location, :variant, presence: true
|
||||
# rubocop:disable Rails/UniqueValidationWithoutIndex
|
||||
validates :variant_id, uniqueness: { scope: :stock_location_id }
|
||||
# rubocop:enable Rails/UniqueValidationWithoutIndex
|
||||
|
||||
attr_accessible :count_on_hand, :variant, :stock_location, :backorderable, :variant_id
|
||||
|
||||
|
||||
Reference in New Issue
Block a user