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
bfccea37
Commit
bfccea37
authored
May 31, 2016
by
Josh Frye
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cache assigned open issue count. Closes #18035
parent
bffe0d63
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
3 deletions
+9
-3
app/models/user.rb
app/models/user.rb
+8
-2
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 @
bfccea37
...
...
@@ -778,8 +778,14 @@ class User < ActiveRecord::Base
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
assigned_merge_requests
.
opened
.
count
end
end
def
assigned_open_issues_count
Rails
.
cache
.
fetch
([
'users'
,
id
,
'assigned_open_issues_count'
],
expires_in:
60
)
do
assigned_issues
.
opened
.
count
end
end
private
...
...
app/views/layouts/nav/_dashboard.html.haml
View file @
bfccea37
...
...
@@ -30,7 +30,7 @@
=
icon
(
'exclamation-circle fw'
)
%span
Issues
%span
.count
=
number_with_delimiter
(
current_user
.
assigned_
issues
.
opened
.
count
)
%span
.count
=
number_with_delimiter
(
current_user
.
assigned_
open_issues_
count
)
=
nav_link
(
path:
'dashboard#merge_requests'
)
do
=
link_to
assigned_mrs_dashboard_path
,
title:
'Merge Requests'
,
class:
'dashboard-shortcuts-merge_requests'
do
=
icon
(
'tasks 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