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 default value for preferences

Damian Legawiec970f7bea5f8d
diff --git a/core/app/models/spree/address.rb b/core/app/models/spree/address.rb
index b8a86ab224..91b05ddb56 100644
--- a/core/app/models/spree/address.rb
+++ b/core/app/models/spree/address.rb
@@ -2,6 +2,10 @@ module Spree
class Address < Spree::Base
require 'twitter_cldr'
+ if Rails::VERSION::STRING >= '6.1'
+ serialize :preferences, Hash, default: {}
+ end
+
NO_ZIPCODE_ISO_CODES ||= [
'AO', 'AG', 'AW', 'BS', 'BZ', 'BJ', 'BM', 'BO', 'BW', 'BF', 'BI', 'CM', 'CF', 'KM', 'CG',
'CD', 'CK', 'CUW', 'CI', 'DJ', 'DM', 'GQ', 'ER', 'FJ', 'TF', 'GAB', 'GM', 'GH', 'GD', 'GN',