diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-02 03:07:41 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-02 03:07:41 +0300 |
commit | 42263d6451c0af3c0e7a61747ffb046a806e4477 (patch) | |
tree | 989941de7bbf543963942e7d9a4b1b89bdf7e386 /app/models/resource_milestone_event.rb | |
parent | 2412ddf03da787012161ea1e8a03787275f9cde9 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models/resource_milestone_event.rb')
-rw-r--r-- | app/models/resource_milestone_event.rb | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/app/models/resource_milestone_event.rb b/app/models/resource_milestone_event.rb index ba43a1ee363..d362ebc307a 100644 --- a/app/models/resource_milestone_event.rb +++ b/app/models/resource_milestone_event.rb @@ -1,10 +1,6 @@ # frozen_string_literal: true -class ResourceMilestoneEvent < ApplicationRecord - include Gitlab::Utils::StrongMemoize - include Importable - include ResourceEventTools - +class ResourceMilestoneEvent < ResourceEvent belongs_to :issue belongs_to :merge_request belongs_to :milestone @@ -12,6 +8,8 @@ class ResourceMilestoneEvent < ApplicationRecord scope :by_issue, ->(issue) { where(issue_id: issue.id) } scope :by_merge_request, ->(merge_request) { where(merge_request_id: merge_request.id) } + validate :exactly_one_issuable + enum action: { add: 1, remove: 2 @@ -23,8 +21,4 @@ class ResourceMilestoneEvent < ApplicationRecord def self.issuable_attrs %i(issue merge_request).freeze end - - def resource - issue || merge_request - end end |