Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-03-22 23:55:00 +0300
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-03-22 23:55:00 +0300
commit43afe46bbd19b1edf60abf3f104fb2b0d29af564 (patch)
treee2a11249408e3403a5a125c50008e77ba1157e57 /app/controllers/users_controller.rb
parent20a12438ab470afe1a5736fc46091a6ef4c30073 (diff)
Refactor contributions events and write tests for calendar
Diffstat (limited to 'app/controllers/users_controller.rb')
-rw-r--r--app/controllers/users_controller.rb10
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