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
Léo-Paul Géneau
gitlab-ce
Commits
dc9916b4
Commit
dc9916b4
authored
Nov 20, 2012
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1998 from erroric/gitlabhq_issue1669
fix for issue #1669
parents
68b119f6
31bf0cd8
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
4 deletions
+4
-4
app/controllers/dashboard_controller.rb
app/controllers/dashboard_controller.rb
+1
-1
app/controllers/groups_controller.rb
app/controllers/groups_controller.rb
+1
-1
app/roles/account.rb
app/roles/account.rb
+2
-2
No files found.
app/controllers/dashboard_controller.rb
View file @
dc9916b4
...
...
@@ -5,7 +5,7 @@ class DashboardController < ApplicationController
def
index
@groups
=
Group
.
where
(
id:
current_user
.
projects
.
pluck
(
:group_id
))
@projects
=
current_user
.
projects_
with_events
@projects
=
current_user
.
projects_
sorted_by_activity
@projects
=
@projects
.
page
(
params
[
:page
]).
per
(
30
)
@events
=
Event
.
in_projects
(
current_user
.
project_ids
)
...
...
app/controllers/groups_controller.rb
View file @
dc9916b4
...
...
@@ -54,7 +54,7 @@ class GroupsController < ApplicationController
end
def
projects
@projects
||=
current_user
.
projects_
with_events
.
where
(
group_id:
@group
.
id
)
@projects
||=
current_user
.
projects_
sorted_by_activity
.
where
(
group_id:
@group
.
id
)
end
def
project_ids
...
...
app/roles/account.rb
View file @
dc9916b4
...
...
@@ -67,7 +67,7 @@ module Account
events
=
events
.
recent
.
limit
(
1
).
first
end
def
projects_
with_events
projects
.
includes
(
:events
).
order
(
"events.created_at
DESC"
)
def
projects_
sorted_by_activity
projects
.
order
(
"(SELECT max(events.created_at) FROM events WHERE events.project_id = projects.id)
DESC"
)
end
end
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