fix compatibility with old events
This commit is contained in:
parent
a951e6f8ae
commit
11e4709fde
|
@ -13,7 +13,7 @@ class ProjectsController < ApplicationController
|
||||||
def index
|
def index
|
||||||
@projects = current_user.projects
|
@projects = current_user.projects
|
||||||
@projects = @projects.select(&:last_activity_date).sort_by(&:last_activity_date).reverse
|
@projects = @projects.select(&:last_activity_date).sort_by(&:last_activity_date).reverse
|
||||||
@events = Event.where(:project_id => @projects.map(&:id)).recent.limit(40)
|
@events = Event.where(:project_id => @projects.map(&:id)).recent.limit(20)
|
||||||
end
|
end
|
||||||
|
|
||||||
def new
|
def new
|
||||||
|
|
|
@ -1,6 +1,12 @@
|
||||||
class GitlabSerialize
|
class GitlabSerialize
|
||||||
# Called to deserialize data to ruby object.
|
# Called to deserialize data to ruby object.
|
||||||
def load(data)
|
def load(data)
|
||||||
|
hash = parse_data(data)
|
||||||
|
hash = HashWithIndifferentAccess.new(hash) if hash
|
||||||
|
hash
|
||||||
|
end
|
||||||
|
|
||||||
|
def parse_data(data)
|
||||||
JSON.load(data)
|
JSON.load(data)
|
||||||
rescue JSON::ParserError
|
rescue JSON::ParserError
|
||||||
begin
|
begin
|
||||||
|
|
Loading…
Reference in a new issue