diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-03-22 13:55:00 -0700 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-03-22 13:55:00 -0700 |
commit | 43afe46bbd19b1edf60abf3f104fb2b0d29af564 (patch) | |
tree | e2a11249408e3403a5a125c50008e77ba1157e57 /app/controllers/users_controller.rb | |
parent | 20a12438ab470afe1a5736fc46091a6ef4c30073 (diff) | |
download | gitlab-ce-43afe46bbd19b1edf60abf3f104fb2b0d29af564.tar.gz |
Refactor contributions events and write tests for calendar
Diffstat (limited to 'app/controllers/users_controller.rb')
-rw-r--r-- | app/controllers/users_controller.rb | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index f39c820626f..f9b568b8af9 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -4,10 +4,7 @@ class UsersController < ApplicationController layout :determine_layout def show - @contributed_projects = Project. - where(id: authorized_projects_ids & @user.contributed_projects_ids). - in_group_namespace. - includes(:namespace). + @contributed_projects = contributed_projects.joined(@user). reject(&:forked?) @projects = @user.personal_projects. @@ -76,11 +73,12 @@ class UsersController < ApplicationController def contributed_projects @contributed_projects = Project. - where(id: authorized_projects_ids & @user.contributed_projects_ids).reject(&:forked?) + where(id: authorized_projects_ids & @user.contributed_projects_ids). + includes(:namespace) end def contributions_calendar @contributions_calendar ||= Gitlab::ContributionsCalendar. - new(contributed_projects, @user) + new(contributed_projects.reject(&:forked?), @user) end end |