diff options
author | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2016-10-19 11:53:31 -0200 |
---|---|---|
committer | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2016-10-19 14:58:28 -0200 |
commit | 4f6d1c1d70d744ff599ae9c51e1cbc3a3c23e13e (patch) | |
tree | 0730947487efa9efd134a5263b209a642ccadbe8 /lib | |
parent | fc2c64fcdf913a37f987ab5e5626ef9bb9e8b854 (diff) | |
download | gitlab-ce-4f6d1c1d70d744ff599ae9c51e1cbc3a3c23e13e.tar.gz |
Rename Labels::CreateService to Labels::FindOrCreateService
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/fogbugz_import/importer.rb | 2 | ||||
-rw-r--r-- | lib/gitlab/github_import/label_formatter.rb | 2 | ||||
-rw-r--r-- | lib/gitlab/google_code_import/importer.rb | 2 | ||||
-rw-r--r-- | lib/gitlab/issues_labels.rb | 2 |
4 files changed, 4 insertions, 4 deletions
diff --git a/lib/gitlab/fogbugz_import/importer.rb b/lib/gitlab/fogbugz_import/importer.rb index f154ee689cf..ce4d87a0741 100644 --- a/lib/gitlab/fogbugz_import/importer.rb +++ b/lib/gitlab/fogbugz_import/importer.rb @@ -75,7 +75,7 @@ module Gitlab def create_label(name) params = { title: name, color: nice_label_color(name) } - ::Labels::CreateService.new(project.owner, project, params).execute + ::Labels::FindOrCreateService.new(project.owner, project, params).execute end def user_info(person_id) diff --git a/lib/gitlab/github_import/label_formatter.rb b/lib/gitlab/github_import/label_formatter.rb index 8ed1574c4fc..942dfb3312b 100644 --- a/lib/gitlab/github_import/label_formatter.rb +++ b/lib/gitlab/github_import/label_formatter.rb @@ -15,7 +15,7 @@ module Gitlab def create! params = attributes.except(:project) - service = ::Labels::CreateService.new(project.owner, project, params) + service = ::Labels::FindOrCreateService.new(project.owner, project, params) label = service.execute raise ActiveRecord::RecordInvalid.new(label) unless label.persisted? diff --git a/lib/gitlab/google_code_import/importer.rb b/lib/gitlab/google_code_import/importer.rb index 904a228aeef..b16a5654096 100644 --- a/lib/gitlab/google_code_import/importer.rb +++ b/lib/gitlab/google_code_import/importer.rb @@ -234,7 +234,7 @@ module Gitlab def create_label(name) params = { name: name, color: nice_label_color(name) } - ::Labels::CreateService.new(project.owner, project, params).execute + ::Labels::FindOrCreateService.new(project.owner, project, params).execute end def format_content(raw_content) diff --git a/lib/gitlab/issues_labels.rb b/lib/gitlab/issues_labels.rb index 6788eca7146..01a2c19ab23 100644 --- a/lib/gitlab/issues_labels.rb +++ b/lib/gitlab/issues_labels.rb @@ -19,7 +19,7 @@ module Gitlab ] labels.each do |params| - ::Labels::CreateService.new(project.owner, project).execute(params) + ::Labels::FindOrCreateService.new(project.owner, project).execute(params) end end end |