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
1
Merge Requests
1
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
nexedi
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
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
0 deletions
+12
-0
CHANGELOG
CHANGELOG
+1
-0
app/models/project.rb
app/models/project.rb
+9
-0
app/services/projects/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)
...
@@ -35,6 +35,7 @@ v 8.0.0 (unreleased)
- Added Drone CI integration (Kirill Zaitsev)
- Added Drone CI integration (Kirill Zaitsev)
- Refactored service API and added automatically service docs generator (Kirill Zaitsev)
- Refactored service API and added automatically service docs generator (Kirill Zaitsev)
- Added web_url key project hook_attrs (Kirill Zaitsev)
- Added web_url key project hook_attrs (Kirill Zaitsev)
- Global Labels that are available to all projects
v 7.14.1
v 7.14.1
- Improve abuse reports management from admin area
- Improve abuse reports management from admin area
...
...
app/models/project.rb
View file @
f5ffeac0
...
@@ -401,6 +401,15 @@ class Project < ActiveRecord::Base
...
@@ -401,6 +401,15 @@ class Project < ActiveRecord::Base
end
end
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
)
def
find_service
(
list
,
name
)
list
.
find
{
|
service
|
service
.
to_param
==
name
}
list
.
find
{
|
service
|
service
.
to_param
==
name
}
end
end
...
...
app/services/projects/create_service.rb
View file @
f5ffeac0
...
@@ -87,6 +87,8 @@ module Projects
...
@@ -87,6 +87,8 @@ module Projects
@project
.
build_missing_services
@project
.
build_missing_services
@project
.
create_labels
event_service
.
create_project
(
@project
,
current_user
)
event_service
.
create_project
(
@project
,
current_user
)
system_hook_service
.
execute_hooks_for
(
@project
,
:create
)
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