diff options
author | Robert Speicher <robert@gitlab.com> | 2016-06-13 21:59:01 +0000 |
---|---|---|
committer | Robert Speicher <robert@gitlab.com> | 2016-06-13 21:59:01 +0000 |
commit | f34af6b83cc2663bb8a076f4df9c82047e5511ab (patch) | |
tree | 1e7be31799bfd35a33f9449c0189480a66591dc4 /app | |
parent | 4a8ae77ebac46545fa4811ea60bf53d1e81f10fc (diff) | |
parent | 4c716de450ecc2959022c67f99f188fff540c6c4 (diff) | |
download | gitlab-ce-f34af6b83cc2663bb8a076f4df9c82047e5511ab.tar.gz |
Merge branch 'remove-deprecated-issues-tracker-columns-from-projects' into 'master'
Remove deprecated issues_tracker and issues_tracker_id from project model
Closes #3941
See merge request !4603
Diffstat (limited to 'app')
-rw-r--r-- | app/models/project.rb | 5 | ||||
-rw-r--r-- | app/models/project_services/issue_tracker_service.rb | 18 |
2 files changed, 3 insertions, 20 deletions
diff --git a/app/models/project.rb b/app/models/project.rb index e2f7ffe493c..dfa99fe0df2 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -146,7 +146,6 @@ class Project < ActiveRecord::Base message: Gitlab::Regex.project_path_regex_message } validates :issues_enabled, :merge_requests_enabled, :wiki_enabled, inclusion: { in: [true, false] } - validates :issues_tracker_id, length: { maximum: 255 }, allow_blank: true validates :namespace, presence: true validates_uniqueness_of :name, scope: :namespace_id validates_uniqueness_of :path, scope: :namespace_id @@ -589,10 +588,6 @@ class Project < ActiveRecord::Base update_column(:has_external_issue_tracker, services.external_issue_trackers.any?) end - def can_have_issues_tracker_id? - self.issues_enabled && !self.default_issues_tracker? - end - def build_missing_services services_templates = Service.where(template: true) diff --git a/app/models/project_services/issue_tracker_service.rb b/app/models/project_services/issue_tracker_service.rb index 6ae9b16d3ce..87ecb3b8b86 100644 --- a/app/models/project_services/issue_tracker_service.rb +++ b/app/models/project_services/issue_tracker_service.rb @@ -38,9 +38,9 @@ class IssueTrackerService < Service if enabled_in_gitlab_config self.properties = { title: issues_tracker['title'], - project_url: add_issues_tracker_id(issues_tracker['project_url']), - issues_url: add_issues_tracker_id(issues_tracker['issues_url']), - new_issue_url: add_issues_tracker_id(issues_tracker['new_issue_url']) + project_url: issues_tracker['project_url'], + issues_url: issues_tracker['issues_url'], + new_issue_url: issues_tracker['new_issue_url'] } else self.properties = {} @@ -83,16 +83,4 @@ class IssueTrackerService < Service def issues_tracker Gitlab.config.issues_tracker[to_param] end - - def add_issues_tracker_id(url) - if self.project - id = self.project.issues_tracker_id - - if id - url = url.gsub(":issues_tracker_id", id) - end - end - - url - end end |