From cc98cc832c76605ed53bcb342826a8d50728b105 Mon Sep 17 00:00:00 2001 From: Matt-Yorkley <9029026+Matt-Yorkley@users.noreply.github.com> Date: Sat, 1 Sep 2018 13:11:47 +0100 Subject: [PATCH] Prefer #public_send over #send --- app/models/product_import/entry_validator.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/models/product_import/entry_validator.rb b/app/models/product_import/entry_validator.rb index 9c20e26415b..54cf742b098 100644 --- a/app/models/product_import/entry_validator.rb +++ b/app/models/product_import/entry_validator.rb @@ -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 @@ -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)