Commit 867bf75

mo <mo.khan@gmail.com>
2019-05-31 03:57:58
start to convert value based on column type
1 parent 45ad39f
Changed files (1)
app
models
app/models/scim/visitor.rb
@@ -47,7 +47,16 @@ module Scim
     end
 
     def cast_value_from(node)
-      DateTime.parse(value_from(node))
+      attr = attr_for(node)
+      value = value_from(node)
+      type = @clazz.columns_hash[attr.to_s].type
+
+      case type
+      when :datetime
+        DateTime.parse(value)
+      else
+        value.to_s
+      end
     end
 
     def attr_for(node)