mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-27 01:43:22 +00:00
11068: update variant_scope method to inline
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user