fix compatibility with old events
This commit is contained in:
parent
a951e6f8ae
commit
11e4709fde
2 changed files with 7 additions and 1 deletions
|
@ -1,6 +1,12 @@
|
|||
class GitlabSerialize
|
||||
# Called to deserialize data to ruby object.
|
||||
def load(data)
|
||||
hash = parse_data(data)
|
||||
hash = HashWithIndifferentAccess.new(hash) if hash
|
||||
hash
|
||||
end
|
||||
|
||||
def parse_data(data)
|
||||
JSON.load(data)
|
||||
rescue JSON::ParserError
|
||||
begin
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue