diff --git a/app/models/product_import/entry_validator.rb b/app/models/product_import/entry_validator.rb index 54cf742b09..ce389e43c3 100644 --- a/app/models/product_import/entry_validator.rb +++ b/app/models/product_import/entry_validator.rb @@ -228,16 +228,12 @@ module ProductImport 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