diff options
author | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2016-10-18 05:27:10 +0300 |
---|---|---|
committer | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2016-10-19 19:58:27 +0300 |
commit | d009d38ed6ab5459f596194ce808c304e6379161 (patch) | |
tree | 4e48d7971255807c008d7c5ff1ade48a92b192af /lib/gitlab/github_import | |
parent | 6c189dcc8e76d5ddb348832500b003bf0d1b49a6 (diff) |
User Labes::CreateService to create labels
Diffstat (limited to 'lib/gitlab/github_import')
-rw-r--r-- | lib/gitlab/github_import/label_formatter.rb | 7 |
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 |