Skip to content

Commit

Permalink
Prefer #public_send over #send
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt-Yorkley committed Sep 19, 2018
1 parent b57c6cf commit cc98cc8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/models/product_import/entry_validator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ def tax_and_shipping_validation(entry, type, category, index)
return if category.blank?

if index.key? category
entry.send("#{type}_category_id=", index[category])
entry.public_send("#{type}_category_id=", index[category])
else
mark_as_invalid(entry, attribute: "#{type}_category", error: I18n.t('admin.product_import.model.not_found'))
end
Expand Down Expand Up @@ -239,11 +239,11 @@ def non_updatable_fields
end

def attributes_match?(attribute, existing_product, entry)
existing_product.send(attribute) == entry.send(attribute)
existing_product.public_send(attribute) == entry.public_send(attribute)
end

def attributes_blank?(attribute, existing_product, entry)
existing_product.send(attribute).blank? && entry.send(attribute).blank?
existing_product.public_send(attribute).blank? && entry.public_send(attribute).blank?
end

def permission_by_name?(supplier_name)
Expand Down

0 comments on commit cc98cc8

Please sign in to comment.