Skip to content
Snippets Groups Projects
Commit f5ffeac0 authored by Valery Sizov's avatar Valery Sizov
Browse files

Create labels in new project

parent 57d00130
No related branches found
No related tags found
1 merge request!1240Global labels
Pipeline #
Loading
@@ -35,6 +35,7 @@ v 8.0.0 (unreleased)
Loading
@@ -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
Loading
Loading
Loading
@@ -401,6 +401,15 @@ class Project < ActiveRecord::Base
Loading
@@ -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
Loading
Loading
Loading
@@ -87,6 +87,8 @@ module Projects
Loading
@@ -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)
   
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment