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
iv
gitlab-ce
Commits
9b9dd3f9
Commit
9b9dd3f9
authored
Sep 05, 2012
by
Alex Denisov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Unnecessary code removed
parent
4bd30245
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
11 deletions
+9
-11
lib/api/projects.rb
lib/api/projects.rb
+9
-11
No files found.
lib/api/projects.rb
View file @
9b9dd3f9
...
@@ -38,17 +38,15 @@ module Gitlab
...
@@ -38,17 +38,15 @@ module Gitlab
# Example Request
# Example Request
# POST /projects
# POST /projects
post
do
post
do
@project
=
Project
.
create_by_user
({
params
[
:code
]
||=
params
[
:name
]
name:
params
[
:name
],
params
[
:path
]
||=
params
[
:name
]
code:
(
params
[
:code
]
||
params
[
:name
]),
project_attrs
=
{}
path:
(
params
[
:path
]
||
params
[
:name
]),
params
.
each_pair
do
|
k
,
v
|
description:
(
params
[
:description
]
||
Project
.
columns_hash
[
"description"
].
default
),
if
Project
.
attribute_names
.
include?
k
default_branch:
(
params
[
:default_branch
]
||
Project
.
columns_hash
[
"default_branch"
].
default
),
project_attrs
[
k
]
=
v
issues_enabled:
(
params
[
:issues_enabled
]
||
Project
.
columns_hash
[
"issues_enabled"
].
default
),
end
wall_enabled:
(
params
[
:wall_enabled
]
||
Project
.
columns_hash
[
"wall_enabled"
].
default
),
end
merge_requests_enabled:
(
params
[
:merge_requests_enabled
]
||
Project
.
columns_hash
[
"merge_requests_enabled"
].
default
),
@project
=
Project
.
create_by_user
(
project_attrs
,
current_user
)
wiki_enabled:
(
params
[
:wiki_enabled
]
||
Project
.
columns_hash
[
"wiki_enabled"
].
default
)
},
current_user
)
if
@project
.
saved?
if
@project
.
saved?
present
@project
,
with:
Entities
::
Project
present
@project
,
with:
Entities
::
Project
else
else
...
...
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