diff options
Diffstat (limited to 'app/models/resource_milestone_event.rb')
-rw-r--r-- | app/models/resource_milestone_event.rb | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/app/models/resource_milestone_event.rb b/app/models/resource_milestone_event.rb index a40af22061e..039f26d8e3f 100644 --- a/app/models/resource_milestone_event.rb +++ b/app/models/resource_milestone_event.rb @@ -2,14 +2,11 @@ class ResourceMilestoneEvent < ResourceEvent include IgnorableColumns + include IssueResourceEvent + include MergeRequestResourceEvent - belongs_to :issue - belongs_to :merge_request belongs_to :milestone - 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: { @@ -25,4 +22,8 @@ class ResourceMilestoneEvent < ResourceEvent def self.issuable_attrs %i(issue merge_request).freeze end + + def milestone_title + milestone&.title + end end |