diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-07-01 15:07:40 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-07-01 15:07:40 +0000 |
commit | 04e74bf311de04c1334343a35fe9954953c6413d (patch) | |
tree | d2d3e62216291c93bb24a79d9221b0eca3efadcb /lib/serializers | |
parent | 098ec8c914f61780b33bb18e929e25ef59dfb175 (diff) | |
download | gitlab-ce-04e74bf311de04c1334343a35fe9954953c6413d.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/serializers')
-rw-r--r-- | lib/serializers/symbolized_json.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/serializers/symbolized_json.rb b/lib/serializers/symbolized_json.rb new file mode 100644 index 00000000000..78192ce3132 --- /dev/null +++ b/lib/serializers/symbolized_json.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Serializers + # Make the resulting hash have deep symbolized keys + class SymbolizedJson + class << self + def dump(obj) + obj + end + + def load(data) + return if data.nil? + + Gitlab::Utils.deep_symbolized_access(data) + end + end + end +end |