fix compatibility with old events

This commit is contained in:
Dmitriy Zaporozhets 2012-04-04 02:49:58 +03:00
parent a951e6f8ae
commit 11e4709fde
2 changed files with 7 additions and 1 deletions

View file

@ -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