Commit 11e4709f authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

fix compatibility with old events

parent a951e6f8
......@@ -13,7 +13,7 @@ class ProjectsController < ApplicationController
def index
@projects = current_user.projects
@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
def new
......
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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment