Module: Milestoneable

Extended by:
ActiveSupport::Concern
Included in:
Issuable
Defined in:
app/models/concerns/milestoneable.rb

Overview

Milestoneable concern

Contains functionality related to objects that can be assigned Milestones

Used by Issuable

Instance Method Summary collapse

Instance Method Details

#milestone_available?Boolean

Returns:

  • (Boolean)

45
46
47
48
49
# File 'app/models/concerns/milestoneable.rb', line 45

def milestone_available?
  return true if milestone_id.blank?

  project_id == milestone&.project_id || project.ancestors_upto.compact.include?(milestone&.group)
end

#supports_milestone?Boolean

Overridden on EE module

Returns:

  • (Boolean)

54
55
56
# File 'app/models/concerns/milestoneable.rb', line 54

def supports_milestone?
  respond_to?(:milestone_id)
end