mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Remove unneccesary method
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user