Commit f6248c25 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

User custom method for services array

parent 93fdc4ca
...@@ -47,7 +47,6 @@ class Project < ActiveRecord::Base ...@@ -47,7 +47,6 @@ class Project < ActiveRecord::Base
has_many :wikis, dependent: :destroy has_many :wikis, dependent: :destroy
has_many :protected_branches, dependent: :destroy has_many :protected_branches, dependent: :destroy
has_one :last_event, class_name: 'Event', order: 'events.created_at DESC', foreign_key: 'project_id' has_one :last_event, class_name: 'Event', order: 'events.created_at DESC', foreign_key: 'project_id'
has_many :services, dependent: :destroy
has_one :gitlab_ci_service, dependent: :destroy has_one :gitlab_ci_service, dependent: :destroy
delegate :name, to: :owner, allow_nil: true, prefix: true 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
def issues_labels def issues_labels
issues.tag_counts_on(:labels) issues.tag_counts_on(:labels)
end end
def services
[gitlab_ci_service].compact
end
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment