9684: update arvados_model -> recursive_stringify to convert ":foo" to "foo"
[arvados.git] / services / api / app / models / arvados_model.rb
index 6cd40a44585c6805278dd9d421c8495d5d66c1c7..a942b57e931fafa50e025b84b7bbd58710f65838 100644 (file)
@@ -398,7 +398,7 @@ class ArvadosModel < ActiveRecord::Base
       end
       false
     else
-      (x.class == Symbol)
+      (x.class == Symbol) or (x.class == String and x.start_with?(':'))
     end
   end
 
@@ -414,7 +414,11 @@ class ArvadosModel < ActiveRecord::Base
     elsif x.is_a? Symbol
       x.to_s
     else
-      x
+      if x.is_a? String and x.start_with?(':')
+        x[1..-1]
+      else
+        x
+      end
     end
   end