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.

Update model

Matthew Kennedye097667e9b81
diff --git a/backend/app/views/spree/admin/payment_methods/_form.html.erb b/backend/app/views/spree/admin/payment_methods/_form.html.erb
index f6f7aa2cb1..79404e5aaa 100644
--- a/backend/app/views/spree/admin/payment_methods/_form.html.erb
+++ b/backend/app/views/spree/admin/payment_methods/_form.html.erb
@@ -26,7 +26,7 @@
<div data-hook="store" class="form-group">
<%= label_tag :payment_method_store, Spree.t(:store) %>
- <%= collection_select(:payment_method, :store_ids, @stores, :id, :unique_name, {}, { miltiple: true, id: 'store_id', class: 'select2-multiple' }) %>
+ <%= collection_select(:payment_method, :store_ids, @stores, :id, :unique_name, {}, { multiple: true, id: 'store_id', class: 'select2' }) %>
<small class="form-text text-muted"><%= Spree.t('payment_method_form.stores_help') %></small>
</div>
diff --git a/core/app/models/spree/payment_method.rb b/core/app/models/spree/payment_method.rb
index f5d94e4baa..3409b69eb5 100644
--- a/core/app/models/spree/payment_method.rb
+++ b/core/app/models/spree/payment_method.rb
@@ -79,9 +79,7 @@ module Spree
end
def available_for_store?(store)
- return true if store.blank? || store_id.blank?
-
- store_id == store.id
+ return true if store_ids.empty? || store_ids.include?(store.id)
end
end
end