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
Jérome Perrin
gitlab-ce
Commits
180fda3d
Commit
180fda3d
authored
Dec 22, 2014
by
Stephan van Leeuwen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated indentation on case when statements.
parent
6af34b0f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
20 deletions
+20
-20
lib/api/projects.rb
lib/api/projects.rb
+20
-20
No files found.
lib/api/projects.rb
View file @
180fda3d
...
...
@@ -25,11 +25,11 @@ module API
sort
=
params
[
:sort
]
==
'desc'
?
'desc'
:
'asc'
@projects
=
case
params
[
"order_by"
]
when
'id'
then
@projects
.
reorder
(
"id
#{
sort
}
"
)
when
'name'
then
@projects
.
reorder
(
"name
#{
sort
}
"
)
when
'created_at'
then
@projects
.
reorder
(
"created_at
#{
sort
}
"
)
when
'last_activity_at'
then
@projects
.
reorder
(
"last_activity_at
#{
sort
}
"
)
else
@projects
when
'id'
then
@projects
.
reorder
(
"id
#{
sort
}
"
)
when
'name'
then
@projects
.
reorder
(
"name
#{
sort
}
"
)
when
'created_at'
then
@projects
.
reorder
(
"created_at
#{
sort
}
"
)
when
'last_activity_at'
then
@projects
.
reorder
(
"last_activity_at
#{
sort
}
"
)
else
@projects
end
# If the archived parameter is passed, limit results accordingly
...
...
@@ -49,11 +49,11 @@ module API
sort
=
params
[
:sort
]
==
'desc'
?
'desc'
:
'asc'
@projects
=
current_user
.
owned_projects
@projects
=
case
params
[
"order_by"
]
when
'id'
then
@projects
.
reorder
(
"id
#{
sort
}
"
)
when
'name'
then
@projects
.
reorder
(
"name
#{
sort
}
"
)
when
'created_at'
then
@projects
.
reorder
(
"created_at
#{
sort
}
"
)
when
'last_activity_at'
then
@projects
.
reorder
(
"last_activity_at
#{
sort
}
"
)
else
@projects
when
'id'
then
@projects
.
reorder
(
"id
#{
sort
}
"
)
when
'name'
then
@projects
.
reorder
(
"name
#{
sort
}
"
)
when
'created_at'
then
@projects
.
reorder
(
"created_at
#{
sort
}
"
)
when
'last_activity_at'
then
@projects
.
reorder
(
"last_activity_at
#{
sort
}
"
)
else
@projects
end
@projects
=
paginate
@projects
...
...
@@ -69,11 +69,11 @@ module API
sort
=
params
[
:sort
]
==
'desc'
?
'desc'
:
'asc'
@projects
=
case
params
[
"order_by"
]
when
'id'
then
Project
.
order
(
"id
#{
sort
}
"
)
when
'name'
then
Project
.
order
(
"name
#{
sort
}
"
)
when
'created_at'
then
Project
.
order
(
"created_at
#{
sort
}
"
)
when
'last_activity_at'
then
Project
.
order
(
"last_activity_at
#{
sort
}
"
)
else
Project
when
'id'
then
Project
.
order
(
"id
#{
sort
}
"
)
when
'name'
then
Project
.
order
(
"name
#{
sort
}
"
)
when
'created_at'
then
Project
.
order
(
"created_at
#{
sort
}
"
)
when
'last_activity_at'
then
Project
.
order
(
"last_activity_at
#{
sort
}
"
)
else
Project
end
@projects
=
paginate
@projects
...
...
@@ -259,11 +259,11 @@ module API
sort
=
params
[
:sort
]
==
'desc'
?
'desc'
:
'asc'
projects
=
case
params
[
"order_by"
]
when
'id'
then
projects
.
order
(
"id
#{
sort
}
"
)
when
'name'
then
projects
.
order
(
"name
#{
sort
}
"
)
when
'created_at'
then
projects
.
order
(
"created_at
#{
sort
}
"
)
when
'last_activity_at'
then
projects
.
order
(
"last_activity_at
#{
sort
}
"
)
else
projects
when
'id'
then
projects
.
order
(
"id
#{
sort
}
"
)
when
'name'
then
projects
.
order
(
"name
#{
sort
}
"
)
when
'created_at'
then
projects
.
order
(
"created_at
#{
sort
}
"
)
when
'last_activity_at'
then
projects
.
order
(
"last_activity_at
#{
sort
}
"
)
else
projects
end
present
paginate
(
projects
),
with:
Entities
::
Project
...
...
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