Sha256: 9dc5e34e662cfab40c07c1781e3511b1bcbce90f77217411e699ce4a983bcf0c
Contents?: true
Size: 533 Bytes
Versions: 13
Compression:
Stored size: 533 Bytes
Contents
module Spree module Metadata extend ActiveSupport::Concern included do attribute :public_metadata, default: {} attribute :private_metadata, default: {} serialize :public_metadata, HashSerializer serialize :private_metadata, HashSerializer end # https://nandovieira.com/using-postgresql-and-jsonb-with-ruby-on-rails class HashSerializer def self.dump(hash) hash end def self.load(hash) (hash || {}).with_indifferent_access end end end end
Version data entries
13 entries across 13 versions & 1 rubygems