Skip to content
Snippets Groups Projects
Commit 68f73024 authored by Marin Jankovski's avatar Marin Jankovski
Browse files

Add a scope for visible services, code styling changes for easier readability.

parent c6c7552e
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -9,7 +9,7 @@ class Projects::ServicesController < Projects::ApplicationController
 
def index
@project.build_missing_services
@services = @project.services.where.not(type: 'GitlabIssueTrackerService').reload
@services = @project.services.visible.reload
end
 
def edit
Loading
Loading
Loading
Loading
@@ -317,11 +317,7 @@ class Project < ActiveRecord::Base
end
 
def default_issue_tracker
unless gitlab_issue_tracker_service
create_gitlab_issue_tracker_service
end
gitlab_issue_tracker_service
gitlab_issue_tracker_service ||= create_gitlab_issue_tracker_service
end
 
def issues_tracker
Loading
Loading
Loading
Loading
@@ -20,6 +20,6 @@ class GitlabIssueTrackerService < IssueTrackerService
end
 
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
Loading
Loading
@@ -26,6 +26,8 @@ class Service < ActiveRecord::Base
 
validates :project_id, presence: true
 
scope :visible, -> { where.not(type: 'GitlabIssueTrackerService') }
def activated?
active
end
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment