Schema Information

Table name: milestones

id          :integer          not null, primary key
title       :string(255)      not null
project_id  :integer          not null
description :text
due_date    :date
closed      :boolean          default(FALSE), not null
created_at  :datetime         not null
updated_at  :datetime         not null
Methods
A
C
E
I
O
P
T
Attributes
[RW] author_id_of_changes
Instance Public methods
author_id()
# File app/models/milestone.rb, line 82
def author_id
  author_id_of_changes
end
can_be_closed?()
# File app/models/milestone.rb, line 70
def can_be_closed?
  open? && issues.opened.count.zero?
end
closed_items_count()
# File app/models/milestone.rb, line 46
def closed_items_count
  self.issues.closed.count + self.merge_requests.closed.count
end
expired?()
# File app/models/milestone.rb, line 30
def expired?
  if due_date
    due_date.past?
  else
    false
  end
end
expires_at()
# File app/models/milestone.rb, line 60
def expires_at
  if due_date
    if due_date.past?
      "expired at #{due_date.stamp("Aug 21, 2011")}"
    else
      "expires at #{due_date.stamp("Aug 21, 2011")}"  
    end
  end  
end
is_empty?()
# File app/models/milestone.rb, line 74
def is_empty?
  total_items_count.zero?
end
open?()
# File app/models/milestone.rb, line 78
def open?
  !closed
end
open_items_count()
# File app/models/milestone.rb, line 42
def open_items_count
  self.issues.opened.count + self.merge_requests.opened.count
end
participants()
# File app/models/milestone.rb, line 38
def participants
  User.where(id: issues.pluck(:assignee_id))
end
percent_complete()
# File app/models/milestone.rb, line 54
def percent_complete
  ((closed_items_count * 100) / total_items_count).abs
rescue ZeroDivisionError
  100
end
total_items_count()
# File app/models/milestone.rb, line 50
def total_items_count
  self.issues.count + self.merge_requests.count
end