11068: update variant_scope method to inline

This commit is contained in:
Ahmed Ejaz
2023-12-28 17:06:21 +05:00
parent 86c2397f63
commit 0fd868b669

View File

@@ -62,7 +62,7 @@ class ProductsReflex < ApplicationReflex
def delete_variant
id = current_id_from_element(element)
variant = variant_scope.find(id)
variant = Spree::Variant.active.find(id)
authorize! :delete, variant
if VariantDeleter.new.delete(variant)
@@ -229,10 +229,6 @@ class ProductsReflex < ApplicationReflex
ProductScopeQuery.new(current_user, { id: })
end
def variant_scope
Spree::Variant.active
end
def current_id_from_element(element)
element.dataset.current_id
end