[ARVADOS] updated: 1.3.0-629-g97d2da208

Git user git at public.curoverse.com
Tue Apr 2 22:14:06 UTC 2019


Summary of changes:
 services/api/app/models/jsonb_type.rb | 19 +++++++++++++------
 1 file changed, 13 insertions(+), 6 deletions(-)

       via  97d2da2083d046057cb589115867eec430706d68 (commit)
      from  33021029867be4a2240f0d3673045dfac7598350 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit 97d2da2083d046057cb589115867eec430706d68
Author: Lucas Di Pentima <ldipentima at veritasgenetics.com>
Date:   Tue Apr 2 19:13:25 2019 -0300

    14873: Fixes JSON custom types.
    
    Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <ldipentima at veritasgenetics.com>

diff --git a/services/api/app/models/jsonb_type.rb b/services/api/app/models/jsonb_type.rb
index 2011dcec8..3f296be55 100644
--- a/services/api/app/models/jsonb_type.rb
+++ b/services/api/app/models/jsonb_type.rb
@@ -7,13 +7,16 @@ class JsonbType
   # some other default value.
   class WithDefault < ActiveModel::Type::Value
     include ActiveModel::Type::Helpers::Mutable
-    @@default_value = nil
+
+    def default_value
+      nil
+    end
 
     def deserialize(value)
       if value.nil?
-        @@default_value
+        self.default_value
       elsif value.is_a?(::String)
-        SafeJSON.load(value) rescue @@default_value
+        SafeJSON.load(value) rescue self.default_value
       else
         value
       end
@@ -21,7 +24,7 @@ class JsonbType
 
     def serialize(value)
       if value.nil?
-        @@default_value
+        self.default_value
       else
         SafeJSON.dump(value)
       end
@@ -29,10 +32,14 @@ class JsonbType
   end
 
   class Hash < JsonbType::WithDefault
-    @@default_value = {}
+    def default_value
+      {}
+    end
   end
 
   class Array < JsonbType::WithDefault
-    @@default_value = []
+    def default_value
+      []
+    end
   end
 end
\ No newline at end of file

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list