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)

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

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

#supports_milestone?Boolean

Overridden on EE module

Returns:

  • (Boolean)

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

def supports_milestone?
  respond_to?(:milestone_id) && !incident?
end