From 3ec62758fe8e93f21c6784108dec067affb8e212 Mon Sep 17 00:00:00 2001 From: Miha Mencin Date: Thu, 31 Jan 2019 09:43:41 +0100 Subject: [PATCH 1/2] SCI-2982, handle the empty json condition --- app/serializers/jsonb_hash_serializer.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/serializers/jsonb_hash_serializer.rb b/app/serializers/jsonb_hash_serializer.rb index f01f29560..cd02b1c67 100644 --- a/app/serializers/jsonb_hash_serializer.rb +++ b/app/serializers/jsonb_hash_serializer.rb @@ -1,6 +1,6 @@ class JsonbHashSerializer def self.dump(hash) - hash.to_json + hash.nil? ? "{}" : hash.to_json end def self.load(hash) From d2dfe68e4665d810d38ff3caa82251881f30f5dd Mon Sep 17 00:00:00 2001 From: Miha Mencin Date: Thu, 31 Jan 2019 10:31:03 +0100 Subject: [PATCH 2/2] Changing double quotes to single quotes --- app/serializers/jsonb_hash_serializer.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/serializers/jsonb_hash_serializer.rb b/app/serializers/jsonb_hash_serializer.rb index cd02b1c67..8105de7bf 100644 --- a/app/serializers/jsonb_hash_serializer.rb +++ b/app/serializers/jsonb_hash_serializer.rb @@ -1,6 +1,6 @@ class JsonbHashSerializer def self.dump(hash) - hash.nil? ? "{}" : hash.to_json + hash.nil? ? '{}' : hash.to_json end def self.load(hash)