BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
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
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
20 deletions
+20
-20
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