Sha256: 7375a580a0875b4145dcc52711848798f354f9e5761a9b0fef2c97fc8d360e9b
Contents?: true
Size: 378 Bytes
Versions: 19
Compression:
Stored size: 378 Bytes
Contents
# This custom serializer excludes nil values module CustomJsonSerializer extend PaperTrail::Serializers::JSON def self.load(string) parsed_value = super(string) parsed_value.is_a?(Hash) ? parsed_value.reject { |k,v| k.blank? || v.blank? } : parsed_value end def self.dump(object) object.is_a?(Hash) ? super(object.reject { |k,v| v.nil? }) : super end end
Version data entries
19 entries across 19 versions & 1 rubygems