Add a scope for visible services, code styling changes for easier readability.
This commit is contained in:
parent
c6c7552e41
commit
68f7302474
4 changed files with 5 additions and 7 deletions
|
@ -9,7 +9,7 @@ class Projects::ServicesController < Projects::ApplicationController
|
||||||
|
|
||||||
def index
|
def index
|
||||||
@project.build_missing_services
|
@project.build_missing_services
|
||||||
@services = @project.services.where.not(type: 'GitlabIssueTrackerService').reload
|
@services = @project.services.visible.reload
|
||||||
end
|
end
|
||||||
|
|
||||||
def edit
|
def edit
|
||||||
|
|
|
@ -317,11 +317,7 @@ class Project < ActiveRecord::Base
|
||||||
end
|
end
|
||||||
|
|
||||||
def default_issue_tracker
|
def default_issue_tracker
|
||||||
unless gitlab_issue_tracker_service
|
gitlab_issue_tracker_service ||= create_gitlab_issue_tracker_service
|
||||||
create_gitlab_issue_tracker_service
|
|
||||||
end
|
|
||||||
|
|
||||||
gitlab_issue_tracker_service
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def issues_tracker
|
def issues_tracker
|
||||||
|
|
|
@ -20,6 +20,6 @@ class GitlabIssueTrackerService < IssueTrackerService
|
||||||
end
|
end
|
||||||
|
|
||||||
def issue_url(iid)
|
def issue_url(iid)
|
||||||
"#{Gitlab.config.gitlab.url}#{project_issue_path project_id: project, id: iid}"
|
"#{Gitlab.config.gitlab.url}#{project_issue_path(project_id: project, id: iid)}"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -26,6 +26,8 @@ class Service < ActiveRecord::Base
|
||||||
|
|
||||||
validates :project_id, presence: true
|
validates :project_id, presence: true
|
||||||
|
|
||||||
|
scope :visible, -> { where.not(type: 'GitlabIssueTrackerService') }
|
||||||
|
|
||||||
def activated?
|
def activated?
|
||||||
active
|
active
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue