From f6248c255e1cd6d6d27f1a8d9ac38adc75157c09 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Tue, 20 Nov 2012 14:22:00 +0200 Subject: [PATCH] User custom method for services array --- app/models/project.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/models/project.rb b/app/models/project.rb index 95a2c6c9f72..d313c778e6d 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -47,7 +47,6 @@ class Project < ActiveRecord::Base has_many :wikis, 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_many :services, dependent: :destroy has_one :gitlab_ci_service, dependent: :destroy delegate :name, to: :owner, allow_nil: true, prefix: true @@ -185,4 +184,8 @@ class Project < ActiveRecord::Base def issues_labels issues.tag_counts_on(:labels) end + + def services + [gitlab_ci_service].compact + end end