Create labels in new project
This commit is contained in:
parent
57d0013090
commit
f5ffeac058
3 changed files with 12 additions and 0 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
Loading…
Reference in a new issue