2020-04-08 14:13:33 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2020-10-24 23:57:45 +05:30
|
|
|
class ResourceMilestoneEvent < ResourceTimeboxEvent
|
2020-04-08 14:13:33 +05:30
|
|
|
belongs_to :milestone
|
|
|
|
|
2020-06-23 00:09:42 +05:30
|
|
|
scope :include_relations, -> { includes(:user, milestone: [:project, :group]) }
|
2023-06-20 00:43:36 +05:30
|
|
|
scope :aliased_for_timebox_report, -> do
|
|
|
|
select("'timebox' AS event_type", "id", "created_at", "milestone_id AS value", "action", "issue_id")
|
|
|
|
end
|
2020-06-23 00:09:42 +05:30
|
|
|
|
2020-04-08 14:13:33 +05:30
|
|
|
# state is used for issue and merge request states.
|
|
|
|
enum state: Issue.available_states.merge(MergeRequest.available_states)
|
|
|
|
|
2020-05-24 23:13:21 +05:30
|
|
|
def milestone_title
|
|
|
|
milestone&.title
|
|
|
|
end
|
2020-06-23 00:09:42 +05:30
|
|
|
|
|
|
|
def milestone_parent
|
|
|
|
milestone&.parent
|
|
|
|
end
|
2023-03-17 16:20:25 +05:30
|
|
|
|
|
|
|
def synthetic_note_class
|
|
|
|
MilestoneNote
|
|
|
|
end
|
2020-04-08 14:13:33 +05:30
|
|
|
end
|