From ead0e1c08d14141f9402a13dbff3ee5cb2362128 Mon Sep 17 00:00:00 2001 From: Matt-Yorkley <9029026+Matt-Yorkley@users.noreply.github.com> Date: Tue, 25 Jun 2019 09:36:47 +0100 Subject: [PATCH] Store attributes list in constant --- app/models/product_import/entry_validator.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/models/product_import/entry_validator.rb b/app/models/product_import/entry_validator.rb index f964326d00..2e7d66b6ba 100644 --- a/app/models/product_import/entry_validator.rb +++ b/app/models/product_import/entry_validator.rb @@ -4,6 +4,8 @@ module ProductImport class EntryValidator + SKIP_VALIDATE_ON_UPDATE = [:description].freeze + # rubocop:disable Metrics/ParameterLists def initialize(current_user, import_time, spreadsheet_data, editable_enterprises, inventory_permissions, reset_counts, import_settings, all_entries) @@ -326,8 +328,7 @@ module ProductImport end def ignore_when_updating_product?(attribute) - attributes_to_ignore = [:description] - attributes_to_ignore.include? attribute + SKIP_VALIDATE_ON_UPDATE.include? attribute end def convert_to_trusted_type(untrusted_attribute, trusted_attribute)