Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
iv
gitlab-ce
Commits
bffe0d63
Commit
bffe0d63
authored
May 31, 2016
by
Josh Frye
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cache assigned merge request count. Closes #18036
parent
f828b744
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
1 deletion
+7
-1
app/models/user.rb
app/models/user.rb
+6
-0
app/views/layouts/nav/_dashboard.html.haml
app/views/layouts/nav/_dashboard.html.haml
+1
-1
No files found.
app/models/user.rb
View file @
bffe0d63
...
...
@@ -776,6 +776,12 @@ class User < ActiveRecord::Base
notification_settings
.
find_or_initialize_by
(
source:
source
)
end
def
assigned_open_merge_request_count
Rails
.
cache
.
fetch
([
'users'
,
id
,
'assigned_open_merge_request_count'
],
expires_in:
60
)
do
assigned_merge_requests
.
opened
.
count
end
end
private
def
projects_union
...
...
app/views/layouts/nav/_dashboard.html.haml
View file @
bffe0d63
...
...
@@ -36,7 +36,7 @@
=
icon
(
'tasks fw'
)
%span
Merge Requests
%span
.count
=
number_with_delimiter
(
current_user
.
assigned_
merge_requests
.
opened
.
count
)
%span
.count
=
number_with_delimiter
(
current_user
.
assigned_
open_merge_request_
count
)
=
nav_link
(
controller: :snippets
)
do
=
link_to
dashboard_snippets_path
,
title:
'Snippets'
do
=
icon
(
'clipboard fw'
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment