Skip to content

Commit

Permalink
Remove unneccesary method
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt-Yorkley committed Sep 1, 2018
1 parent 43b96e7 commit 8cab4d5
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions app/models/product_import/entry_validator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 8cab4d5

Please sign in to comment.