2020-02-19 13:09:10 -05:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2020-08-11 05:10:03 -04:00
|
|
|
class ResourceMilestoneEvent < ResourceTimeboxEvent
|
2020-03-23 11:09:36 -04:00
|
|
|
include IgnorableColumns
|
|
|
|
|
2020-02-19 13:09:10 -05:00
|
|
|
belongs_to :milestone
|
|
|
|
|
2020-05-26 11:08:17 -04:00
|
|
|
scope :include_relations, -> { includes(:user, milestone: [:project, :group]) }
|
|
|
|
|
2020-02-19 13:09:10 -05:00
|
|
|
# state is used for issue and merge request states.
|
|
|
|
enum state: Issue.available_states.merge(MergeRequest.available_states)
|
|
|
|
|
2020-03-23 11:09:36 -04:00
|
|
|
ignore_columns %i[reference reference_html cached_markdown_version], remove_with: '13.1', remove_after: '2020-06-22'
|
|
|
|
|
2020-04-27 11:10:16 -04:00
|
|
|
def milestone_title
|
|
|
|
milestone&.title
|
|
|
|
end
|
2020-05-26 11:08:17 -04:00
|
|
|
|
|
|
|
def milestone_parent
|
|
|
|
milestone&.parent
|
|
|
|
end
|
2020-02-19 13:09:10 -05:00
|
|
|
end
|