From 8cab4d5fc04dc6edf35f53b5881ecac9a020dec2 Mon Sep 17 00:00:00 2001 From: Matt-Yorkley <9029026+Matt-Yorkley@users.noreply.github.com> Date: Sat, 1 Sep 2018 13:33:27 +0100 Subject: [PATCH] Remove unneccesary method --- app/models/product_import/entry_validator.rb | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/app/models/product_import/entry_validator.rb b/app/models/product_import/entry_validator.rb index 3efaeab45d6..4922669e2ec 100644 --- a/app/models/product_import/entry_validator.rb +++ b/app/models/product_import/entry_validator.rb @@ -233,16 +233,12 @@ def mark_as_existing_variant(entry, existing_variant) end def product_field_errors(entry, existing_product) - non_updatable_fields.each do |display_name, attribute| + EntryValidator.non_updatable_fields.each do |display_name, attribute| next if attributes_match?(attribute, existing_product, entry) || attributes_blank?(attribute, existing_product, entry) mark_as_invalid(entry, attribute: display_name, error: I18n.t('admin.product_import.model.not_updatable')) end end - def non_updatable_fields - EntryValidator.non_updatable_fields - end - def attributes_match?(attribute, existing_product, entry) existing_product.public_send(attribute) == entry.public_send(attribute) end