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
02e7f00f167a
Commit
02e7f00f
authored
Sep 03, 2015
by
Valery Sizov
Browse files
Create labels in new project
parent
ee879b7c507f
Changes
3
Hide whitespace changes
Inline
Side-by-side
CHANGELOG
View file @
02e7f00f
...
...
@@ -35,6 +35,7 @@
- Added Drone CI integration (Kirill Zaitsev)
- Refactored service API and added automatically service docs generator (Kirill Zaitsev)
- Added web_url key project hook_attrs (Kirill Zaitsev)
- Global Labels that are available to all projects
v 7.14.1
- Improve abuse reports management from admin area
...
...
app/models/project.rb
View file @
02e7f00f
...
...
@@ -401,6 +401,15 @@
end
end
def
create_labels
Label
.
templates
.
each
do
|
label
|
label
=
label
.
dup
label
.
template
=
nil
label
.
project_id
=
self
.
id
label
.
save
end
end
def
find_service
(
list
,
name
)
list
.
find
{
|
service
|
service
.
to_param
==
name
}
end
...
...
app/services/projects/create_service.rb
View file @
02e7f00f
...
...
@@ -87,6 +87,8 @@
@project
.
build_missing_services
@project
.
create_labels
event_service
.
create_project
(
@project
,
current_user
)
system_hook_service
.
execute_hooks_for
(
@project
,
:create
)
...
...
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