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:
Matt-Yorkley
2019-12-22 15:07:06 +01:00
committed by Luis Ramos
parent 241e9221b4
commit 98fdbb8621
23 changed files with 30 additions and 30 deletions

View File

@@ -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.

View File

@@ -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