From e12e50aa84b5621bbb2e71ca06206fc4368402c0 Mon Sep 17 00:00:00 2001 From: Luis Ramos Date: Mon, 22 Jun 2020 17:55:54 +0100 Subject: [PATCH] Move rubocop exception to rubocop todo --- .rubocop_todo.yml | 7 +++++++ app/models/spree/stock_item.rb | 2 -- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 753aaee48e..a0c6a0b30c 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -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 diff --git a/app/models/spree/stock_item.rb b/app/models/spree/stock_item.rb index f71df2b942..cf86103453 100644 --- a/app/models/spree/stock_item.rb +++ b/app/models/spree/stock_item.rb @@ -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