Skip to content

Commit f718d86

Browse files
committed
Add defaults for admin_metadata and customer_metadata
If the default value is not passed the attributes will be nil instead of an empty json object so the empty json would now be default for the attributes.
1 parent d6669a1 commit f718d86

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

core/app/models/concerns/spree/metadata.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ module Metadata
55
extend ActiveSupport::Concern
66

77
included do
8-
attribute :customer_metadata, :json
9-
attribute :admin_metadata, :json
8+
attribute :customer_metadata, :json, default: {}
9+
attribute :admin_metadata, :json, default: {}
1010

1111
validate :validate_metadata_limits
1212
end

0 commit comments

Comments
 (0)