Class: Issue::Metrics

Inherits:
ApplicationRecord show all
Defined in:
app/models/issue/metrics.rb

Instance Method Summary collapse

Methods inherited from ApplicationRecord

at_most, id_in, id_not_in, iid_in, pluck_primary_key, primary_key_in, safe_ensure_unique, safe_find_or_create_by, safe_find_or_create_by!, underscore, without_order

Instance Method Details

#record!Object


12
13
14
15
16
17
18
19
20
21
22
# File 'app/models/issue/metrics.rb', line 12

def record!
  if issue.milestone_id.present? && self.first_associated_with_milestone_at.blank?
    self.first_associated_with_milestone_at = Time.current
  end

  if issue_assigned_to_list_label? && self.first_added_to_board_at.blank?
    self.first_added_to_board_at = Time.current
  end

  self.save
end