mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Move rubocop exception to rubocop todo
This commit is contained in:
@@ -363,6 +363,13 @@ Rails/UniqueValidationWithoutIndex:
|
||||
- 'app/models/customer.rb'
|
||||
- 'app/models/exchange.rb'
|
||||
|
||||
# Offense count: 2
|
||||
# Configuration parameters: Include.
|
||||
# Include: app/models/**/*.rb
|
||||
Rails/UniqueValidationWithoutIndex:
|
||||
Exclude:
|
||||
- 'app/models/spree/stock_item.rb'
|
||||
|
||||
# Offense count: 1
|
||||
# Configuration parameters: Environments.
|
||||
# Environments: development, test, production
|
||||
|
||||
@@ -7,9 +7,7 @@ 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
|
||||
validates :count_on_hand, numericality: { greater_than_or_equal_to: 0, unless: :backorderable? }
|
||||
|
||||
attr_accessible :count_on_hand, :variant, :stock_location, :backorderable, :variant_id
|
||||
|
||||
Reference in New Issue
Block a user