summaryrefslogtreecommitdiff
path: root/lib/serializers/json.rb
diff options
context:
space:
mode:
authorDeAndre Harris <dharris@gitlab.com>2019-07-29 09:45:20 +0000
committerDeAndre Harris <dharris@gitlab.com>2019-07-29 09:45:20 +0000
commit88b4b9bd2e8224e17ff089d2a8ea99f800686b70 (patch)
tree67e6fadf31d75860f2158c05168f160d52ae46fe /lib/serializers/json.rb
parent750fd7374ae67bb6ed4d9d875052bbc6d86d9b31 (diff)
parent77926ea02512d836c61a30e3986902e2d8e7f886 (diff)
downloadgitlab-ce-docs-troubleshoot-scim.tar.gz
Merge branch 'master' into 'docs-troubleshoot-scim'docs-troubleshoot-scim
# Conflicts: # doc/user/group/saml_sso/scim_setup.md
Diffstat (limited to 'lib/serializers/json.rb')
-rw-r--r--lib/serializers/json.rb18
1 files changed, 1 insertions, 17 deletions
diff --git a/lib/serializers/json.rb b/lib/serializers/json.rb
index 93cb192087a..1ed5d5dc3f5 100644
--- a/lib/serializers/json.rb
+++ b/lib/serializers/json.rb
@@ -1,32 +1,16 @@
# frozen_string_literal: true
module Serializers
- # This serializer exports data as JSON,
- # it is designed to be used with interwork compatibility between MySQL and PostgreSQL
- # implementations, as used version of MySQL does not support native json type
- #
- # Secondly, the loader makes the resulting hash to have deep indifferent access
+ # Make the resulting hash have deep indifferent access
class JSON
class << self
def dump(obj)
- # MySQL stores data as text
- # look at ./config/initializers/ar_mysql_jsonb_support.rb
- if Gitlab::Database.mysql?
- obj = ActiveSupport::JSON.encode(obj)
- end
-
obj
end
def load(data)
return if data.nil?
- # On MySQL we store data as text
- # look at ./config/initializers/ar_mysql_jsonb_support.rb
- if Gitlab::Database.mysql?
- data = ActiveSupport::JSON.decode(data)
- end
-
Gitlab::Utils.deep_indifferent_access(data)
end
end