diff options
author | Timothy Andrew <mail@timothyandrew.net> | 2016-08-25 09:25:07 +0300 |
---|---|---|
committer | Timothy Andrew <mail@timothyandrew.net> | 2016-08-26 13:58:20 +0300 |
commit | 14d6317ebc756ee6b27a3a8cd39927238f6d757c (patch) | |
tree | 740864ad89ca36b966a05b148c0690e5b4a5c868 /app/models/merge_request | |
parent | 487906b3861068a8f81125814f919a07bfab8469 (diff) |
Add the "Review" cycle analytics section.
Diffstat (limited to 'app/models/merge_request')
-rw-r--r-- | app/models/merge_request/metrics.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/app/models/merge_request/metrics.rb b/app/models/merge_request/metrics.rb index 7f7cf95e388..a0bc41c9cc1 100644 --- a/app/models/merge_request/metrics.rb +++ b/app/models/merge_request/metrics.rb @@ -10,6 +10,14 @@ class MergeRequest::Metrics < ActiveRecord::Base self.first_assigned_to_user_other_than_author = Time.now end + if merge_request.merged? && self.merged_at.blank? + self.merged_at = Time.now + end + + if merge_request.closed? && self.first_closed_at.blank? + self.first_closed_at = Time.now + end + self.save if self.changed? end end |