diff options
author | Marin Jankovski <maxlazio@gmail.com> | 2015-01-27 09:08:27 +0300 |
---|---|---|
committer | Marin Jankovski <maxlazio@gmail.com> | 2015-01-27 09:08:27 +0300 |
commit | 33913f9b8fef1f8df45dc26239faf8fa4cffc982 (patch) | |
tree | d8e1686bf7c74e6c936ab2598a9780b46afae28c /app | |
parent | 00a0d5aeeaf19ea4d72fd1890afac099026f1706 (diff) |
Make issue tracker service fields required.
Diffstat (limited to 'app')
-rw-r--r-- | app/models/project.rb | 2 | ||||
-rw-r--r-- | app/models/project_services/issue_tracker_service.rb | 4 |
2 files changed, 5 insertions, 1 deletions
diff --git a/app/models/project.rb b/app/models/project.rb index de31f14b98e..43b61897a3c 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -319,7 +319,7 @@ class Project < ActiveRecord::Base end def external_issues_trackers - services.select { |service| service.category == :issue_tracker } + services.select { |service| service.issue_tracker? } end def external_issue_tracker diff --git a/app/models/project_services/issue_tracker_service.rb b/app/models/project_services/issue_tracker_service.rb index 7ff6e0f284d..fc7b2fe5acd 100644 --- a/app/models/project_services/issue_tracker_service.rb +++ b/app/models/project_services/issue_tracker_service.rb @@ -1,5 +1,7 @@ class IssueTrackerService < Service + validates :project_url, :issues_url, :new_issue_url, presence: true, if: :activated? + def category :issue_tracker end @@ -34,6 +36,8 @@ class IssueTrackerService < Service issues_url: issues_tracker['issues_url'], new_issue_url: issues_tracker['new_issue_url'] } + else + self.properties = {} end end end |