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
Kazuhiko Shiozaki
gitlab-ce
Commits
34c2d8e8
Commit
34c2d8e8
authored
Nov 28, 2012
by
Alex Denisov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
authorized_for scope added to project
parent
15a72a3b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
1 deletion
+2
-1
app/models/project.rb
app/models/project.rb
+1
-0
app/views/dashboard/_groups.html.haml
app/views/dashboard/_groups.html.haml
+1
-1
No files found.
app/models/project.rb
View file @
34c2d8e8
...
...
@@ -73,6 +73,7 @@ class Project < ActiveRecord::Base
scope
:public_only
,
where
(
private_flag:
false
)
scope
:without_user
,
->
(
user
)
{
where
(
"id NOT IN (:ids)"
,
ids:
user
.
projects
.
map
(
&
:id
)
)
}
scope
:not_in_group
,
->
(
group
)
{
where
(
"id NOT IN (:ids)"
,
ids:
group
.
project_ids
)
}
scope
:authorized_for
,
->
(
user
)
{
joins
(
:users_projects
)
{
where
(
user_id:
user
.
id
)
}
}
class
<<
self
def
active
...
...
app/views/dashboard/_groups.html.haml
View file @
34c2d8e8
...
...
@@ -17,4 +17,4 @@
→
%span
.last_activity
%strong
Projects:
%span
=
group
.
projects
.
count
%span
=
group
.
projects
.
authorized_for
(
current_user
).
count
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