Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
heptapod
heptapod
Commits
1c6613a2fc5b
Commit
1c6613a2
authored
Jan 14, 2013
by
Dmitriy Zaporozhets
Browse files
profjects filter with_push to project model
parent
848bb9d07ef1
Changes
2
Hide whitespace changes
Inline
Side-by-side
app/controllers/admin/projects_controller.rb
View file @
1c6613a2
...
...
@@ -5,7 +5,7 @@
@projects
=
Project
.
scoped
@projects
=
@projects
.
where
(
namespace_id:
params
[
:namespace_id
])
if
params
[
:namespace_id
].
present?
@projects
=
@projects
.
where
(
public:
true
)
if
params
[
:public_only
].
present?
@projects
=
@projects
.
joins
(
:events
).
where
(
'events.action = ?'
,
Event
::
Pushed
)
if
params
[
:with_push
].
present?
@projects
=
@projects
.
with_push
if
params
[
:with_push
].
present?
@projects
=
@projects
.
abandoned
if
params
[
:abandoned
].
present?
@projects
=
@projects
.
where
(
namespace_id:
nil
)
if
params
[
:namespace_id
]
==
Namespace
.
global_id
@projects
=
@projects
.
search
(
params
[
:name
])
if
params
[
:name
].
present?
...
...
app/models/project.rb
View file @
1c6613a2
...
...
@@ -92,6 +92,10 @@
where
(
id:
project_ids
)
end
def
with_push
includes
(
:events
).
where
(
'events.action = ?'
,
Event
::
Pushed
)
end
def
active
joins
(
:issues
,
:notes
,
:merge_requests
).
order
(
"issues.created_at, notes.created_at, merge_requests.created_at DESC"
)
end
...
...
Write
Preview
Supports
Markdown
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