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.

Fix `Store.by_url` with active record encryption (#12704)

Damian Legawiecbdfcec2ad7aa
diff --git a/core/app/models/spree/store.rb b/core/app/models/spree/store.rb
index bb493761eb..68d9ba8d82 100644
--- a/core/app/models/spree/store.rb
+++ b/core/app/models/spree/store.rb
@@ -190,7 +190,7 @@ module Spree
#
default_scope { order(created_at: :asc) }
scope :by_custom_domain, ->(url) { left_joins(:custom_domains).where("#{Spree::CustomDomain.table_name}.url" => url) }
- scope :by_url, ->(url) { where("#{table_name}.url like ?", "%#{url}%") }
+ scope :by_url, ->(url) { where(url: url).or(where("#{table_name}.url like ?", "%#{url}%")) }
#
# Delegations