diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-05-26 18:08:17 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-05-26 18:08:17 +0300 |
commit | c9d79ef3b5b67792e331a4cc8e6325f3b4a04760 (patch) | |
tree | 0b7c48c03e5c59362f975c20fcf84635fddd94e6 /app/models/resource_milestone_event.rb | |
parent | 1691cbe307f7698b3ee39811278990c43b6751a5 (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 | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/app/models/resource_milestone_event.rb b/app/models/resource_milestone_event.rb index 039f26d8e3f..36068cf508b 100644 --- a/app/models/resource_milestone_event.rb +++ b/app/models/resource_milestone_event.rb @@ -9,6 +9,8 @@ class ResourceMilestoneEvent < ResourceEvent validate :exactly_one_issuable + scope :include_relations, -> { includes(:user, milestone: [:project, :group]) } + enum action: { add: 1, remove: 2 @@ -26,4 +28,12 @@ class ResourceMilestoneEvent < ResourceEvent def milestone_title milestone&.title end + + def milestone_parent + milestone&.parent + end + + def issuable + issue || merge_request + end end |