diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-06-29 12:09:01 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-06-29 12:09:01 +0300 |
commit | 9ce66d4dcfe444ac27fb13b3e064de8bbf3572ef (patch) | |
tree | 6724f5ee3fbc7e5b9290a8951035c9c09d8f4437 /app/models | |
parent | 7bc73460c0262e1686cdf00be4673f10ffabd1a4 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/project.rb | 1 | ||||
-rw-r--r-- | app/models/project_services/gitlab_issue_tracker_service.rb | 45 | ||||
-rw-r--r-- | app/models/service.rb | 4 |
3 files changed, 1 insertions, 49 deletions
diff --git a/app/models/project.rb b/app/models/project.rb index 3410c5c9a25..ad0fa32a0ee 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -167,7 +167,6 @@ class Project < ApplicationRecord has_one :youtrack_service has_one :custom_issue_tracker_service has_one :bugzilla_service - has_one :gitlab_issue_tracker_service, inverse_of: :project has_one :external_wiki_service has_one :prometheus_service, inverse_of: :project has_one :mock_ci_service diff --git a/app/models/project_services/gitlab_issue_tracker_service.rb b/app/models/project_services/gitlab_issue_tracker_service.rb deleted file mode 100644 index b3f44e040bc..00000000000 --- a/app/models/project_services/gitlab_issue_tracker_service.rb +++ /dev/null @@ -1,45 +0,0 @@ -# frozen_string_literal: true - -class GitlabIssueTrackerService < IssueTrackerService - include Gitlab::Routing - - validates :project_url, :issues_url, :new_issue_url, presence: true, public_url: true, if: :activated? - - default_value_for :default, true - - def title - 'GitLab' - end - - def description - s_('IssueTracker|GitLab issue tracker') - end - - def self.to_param - 'gitlab' - end - - def project_url - project_issues_url(project) - end - - def new_issue_url - new_project_issue_url(project) - end - - def issue_url(iid) - project_issue_url(project, id: iid) - end - - def issue_tracker_path - project_issues_path(project) - end - - def new_issue_path - new_project_issue_path(project) - end - - def issue_path(iid) - project_issue_path(project, id: iid) - end -end diff --git a/app/models/service.rb b/app/models/service.rb index e310ff9abd2..68da7410cb0 100644 --- a/app/models/service.rb +++ b/app/models/service.rb @@ -55,11 +55,9 @@ class Service < ApplicationRecord validates :instance, uniqueness: { scope: :type }, if: -> { instance? } validate :validate_is_instance_or_template - scope :visible, -> { where.not(type: 'GitlabIssueTrackerService') } scope :issue_trackers, -> { where(category: 'issue_tracker') } scope :external_wikis, -> { where(type: 'ExternalWikiService').active } scope :active, -> { where(active: true) } - scope :without_defaults, -> { where(default: false) } scope :by_type, -> (type) { where(type: type) } scope :by_active_flag, -> (flag) { where(active: flag) } scope :templates, -> { where(template: true, type: available_services_types) } @@ -77,7 +75,7 @@ class Service < ApplicationRecord scope :wiki_page_hooks, -> { where(wiki_page_events: true, active: true) } scope :deployment_hooks, -> { where(deployment_events: true, active: true) } scope :alert_hooks, -> { where(alert_events: true, active: true) } - scope :external_issue_trackers, -> { issue_trackers.active.without_defaults } + scope :external_issue_trackers, -> { issue_trackers.active } scope :deployment, -> { where(category: 'deployment') } default_value_for :category, 'common' |