Commit f6248c255e1cd6d6d27f1a8d9ac38adc75157c09
1 parent
93fdc4ca
Exists in
master
and in
4 other branches
User custom method for services array
Showing
1 changed file
with
4 additions
and
1 deletions
Show diff stats
app/models/project.rb
@@ -47,7 +47,6 @@ class Project < ActiveRecord::Base | @@ -47,7 +47,6 @@ class Project < ActiveRecord::Base | ||
47 | has_many :wikis, dependent: :destroy | 47 | has_many :wikis, dependent: :destroy |
48 | has_many :protected_branches, dependent: :destroy | 48 | has_many :protected_branches, dependent: :destroy |
49 | has_one :last_event, class_name: 'Event', order: 'events.created_at DESC', foreign_key: 'project_id' | 49 | has_one :last_event, class_name: 'Event', order: 'events.created_at DESC', foreign_key: 'project_id' |
50 | - has_many :services, dependent: :destroy | ||
51 | has_one :gitlab_ci_service, dependent: :destroy | 50 | has_one :gitlab_ci_service, dependent: :destroy |
52 | 51 | ||
53 | delegate :name, to: :owner, allow_nil: true, prefix: true | 52 | delegate :name, to: :owner, allow_nil: true, prefix: true |
@@ -185,4 +184,8 @@ class Project < ActiveRecord::Base | @@ -185,4 +184,8 @@ class Project < ActiveRecord::Base | ||
185 | def issues_labels | 184 | def issues_labels |
186 | issues.tag_counts_on(:labels) | 185 | issues.tag_counts_on(:labels) |
187 | end | 186 | end |
187 | + | ||
188 | + def services | ||
189 | + [gitlab_ci_service].compact | ||
190 | + end | ||
188 | end | 191 | end |