Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouglas Barbosa Alexandre <dbalexandre@gmail.com>2016-10-18 05:27:10 +0300
committerDouglas Barbosa Alexandre <dbalexandre@gmail.com>2016-10-19 19:58:27 +0300
commitd009d38ed6ab5459f596194ce808c304e6379161 (patch)
tree4e48d7971255807c008d7c5ff1ade48a92b192af /lib/gitlab/github_import
parent6c189dcc8e76d5ddb348832500b003bf0d1b49a6 (diff)
User Labes::CreateService to create labels
Diffstat (limited to 'lib/gitlab/github_import')
-rw-r--r--lib/gitlab/github_import/label_formatter.rb7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/gitlab/github_import/label_formatter.rb b/lib/gitlab/github_import/label_formatter.rb
index 2cad7fca88e..3101116a614 100644
--- a/lib/gitlab/github_import/label_formatter.rb
+++ b/lib/gitlab/github_import/label_formatter.rb
@@ -14,9 +14,10 @@ module Gitlab
end
def create!
- project.labels.find_or_create_by!(title: title) do |label|
- label.color = color
- end
+ params = attributes.except(:project)
+ service = ::Labels::CreateService.new(project.owner, project, params)
+
+ service.execute
end
private