Skip to content

Commit

Permalink
User custom method for services array
Browse files Browse the repository at this point in the history
  • Loading branch information
dzaporozhets committed Nov 20, 2012
1 parent 93fdc4c commit f6248c2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion app/models/project.rb
Expand Up @@ -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
Expand Down Expand Up @@ -185,4 +184,8 @@ def project_id
def issues_labels
issues.tag_counts_on(:labels)
end

def services
[gitlab_ci_service].compact
end
end

0 comments on commit f6248c2

Please sign in to comment.