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
f5ffeac0
Commit
f5ffeac0
authored
Sep 03, 2015
by
Valery Sizov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Create labels in new project
parent
57d00130
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
0 deletions
+12
-0
CHANGELOG
CHANGELOG
+1
-0
project.rb
app/models/project.rb
+9
-0
create_service.rb
app/services/projects/create_service.rb
+2
-0
No files found.
CHANGELOG
View file @
f5ffeac0
...
...
@@ -35,6 +35,7 @@ v 8.0.0 (unreleased)
- 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 @
f5ffeac0
...
...
@@ -401,6 +401,15 @@ class Project < ActiveRecord::Base
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 @
f5ffeac0
...
...
@@ -87,6 +87,8 @@ module Projects
@project
.
build_missing_services
@project
.
create_labels
event_service
.
create_project
(
@project
,
current_user
)
system_hook_service
.
execute_hooks_for
(
@project
,
:create
)
...
...
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