Skip to content

armgit / spree

Public Imported from GitHub
0

Open Source Platform for DTC, B2B Commerce, Marketplaces & Omnichannel. REST APIs, TypeScript SDKs, and production-ready Next.js storefront. Self-host it. Own your data. No vendor lock-in. Zero platform fees.

User Product.like_any in Storefront Products API (#11225)

Damian Legawiec235c200d0219
diff --git a/core/app/finders/spree/products/find.rb b/core/app/finders/spree/products/find.rb
index b80e1c0ba9..03ae5ad795 100644
--- a/core/app/finders/spree/products/find.rb
+++ b/core/app/finders/spree/products/find.rb
@@ -96,10 +96,6 @@ module Spree
properties.present? && properties.values.reject(&:empty?).present?
end
- def name_matcher
- Spree::Product.arel_table[:name].matches("%#{name}%")
- end
-
def by_ids(products)
return products unless ids?
@@ -146,7 +142,7 @@ module Spree
def by_name(products)
return products unless name?
- products.where(name_matcher)
+ products.like_any([:name], [name])
end
def by_options(products)