Remove unneccesary method

This commit is contained in:
Matt-Yorkley
2018-09-01 13:33:27 +01:00
parent cc98cc832c
commit ebb18e9394

View File

@@ -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