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.

Address: Use ADDRESS_FIELDS for whitelisted_ransackable_attributes and add whitelisted_ransackable_associations

Damian Legawiec62d2f60f14b2
diff --git a/core/app/models/spree/address.rb b/core/app/models/spree/address.rb
index 91b05ddb56..eb541661ad 100644
--- a/core/app/models/spree/address.rb
+++ b/core/app/models/spree/address.rb
@@ -53,7 +53,8 @@ module Spree
alias_attribute :first_name, :firstname
alias_attribute :last_name, :lastname
- self.whitelisted_ransackable_attributes = %w[firstname lastname company]
+ self.whitelisted_ransackable_attributes = ADDRESS_FIELDS
+ self.whitelisted_ransackable_associations = %w[country state user]
def self.build_default
new(country: Spree::Country.default)