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.

Set name don't use it in find.

Matthew Kennedye935d98ffa4d
diff --git a/core/app/models/concerns/spree/user_methods.rb b/core/app/models/concerns/spree/user_methods.rb
index eead77326e..4a72b067b2 100644
--- a/core/app/models/concerns/spree/user_methods.rb
+++ b/core/app/models/concerns/spree/user_methods.rb
@@ -69,7 +69,10 @@ module Spree
end
def default_wishlist_for_store(current_store)
- wishlists.find_or_create_by(name: Spree.t(:default_wishlist_name), is_default: true, store_id: current_store.id)
+ wishlists.find_or_create_by(is_default: true, store_id: current_store.id) do |wishlist|
+ wishlist.name = Spree.t(:default_wishlist_name)
+ wishlist.save
+ end
end
private