mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-31 06:31:41 +00:00
Update deprecated #scoped calls
Model#scoped is now deprecated. Model#where(nil) in Rails 4 returns the same result as Model#scoped in Rails 3
This commit is contained in:
@@ -119,7 +119,7 @@ module Api
|
||||
end
|
||||
|
||||
def paged_products_for_producers(producers)
|
||||
Spree::Product.scoped.
|
||||
Spree::Product.where(nil).
|
||||
merge(product_scope).
|
||||
where(supplier_id: producers).
|
||||
by_producer.by_name.
|
||||
|
||||
@@ -58,7 +58,7 @@ module Api
|
||||
@product.variants_including_master
|
||||
end
|
||||
else
|
||||
variants = Spree::Variant.scoped
|
||||
variants = Spree::Variant.where(nil)
|
||||
if current_api_user.has_spree_role?("admin")
|
||||
unless params[:show_deleted]
|
||||
variants = Spree::Variant.active
|
||||
|
||||
Reference in New Issue
Block a user