Commit 11e4709fde69c766ebb18c3277602837955f7317
1 parent
a951e6f8
Exists in
master
and in
4 other branches
fix compatibility with old events
Showing
2 changed files
with
7 additions
and
1 deletions
Show diff stats
app/controllers/projects_controller.rb
| @@ -13,7 +13,7 @@ class ProjectsController < ApplicationController | @@ -13,7 +13,7 @@ class ProjectsController < ApplicationController | ||
| 13 | def index | 13 | def index |
| 14 | @projects = current_user.projects | 14 | @projects = current_user.projects |
| 15 | @projects = @projects.select(&:last_activity_date).sort_by(&:last_activity_date).reverse | 15 | @projects = @projects.select(&:last_activity_date).sort_by(&:last_activity_date).reverse |
| 16 | - @events = Event.where(:project_id => @projects.map(&:id)).recent.limit(40) | 16 | + @events = Event.where(:project_id => @projects.map(&:id)).recent.limit(20) |
| 17 | end | 17 | end |
| 18 | 18 | ||
| 19 | def new | 19 | def new |
app/models/gitlab_serialize.rb
| 1 | class GitlabSerialize | 1 | class GitlabSerialize |
| 2 | # Called to deserialize data to ruby object. | 2 | # Called to deserialize data to ruby object. |
| 3 | def load(data) | 3 | def load(data) |
| 4 | + hash = parse_data(data) | ||
| 5 | + hash = HashWithIndifferentAccess.new(hash) if hash | ||
| 6 | + hash | ||
| 7 | + end | ||
| 8 | + | ||
| 9 | + def parse_data(data) | ||
| 4 | JSON.load(data) | 10 | JSON.load(data) |
| 5 | rescue JSON::ParserError | 11 | rescue JSON::ParserError |
| 6 | begin | 12 | begin |