diff options
Diffstat (limited to 'app/models/merge_request/metrics.rb')
-rw-r--r-- | app/models/merge_request/metrics.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/app/models/merge_request/metrics.rb b/app/models/merge_request/metrics.rb new file mode 100644 index 00000000000..99c49a020c9 --- /dev/null +++ b/app/models/merge_request/metrics.rb @@ -0,0 +1,11 @@ +class MergeRequest::Metrics < ActiveRecord::Base + belongs_to :merge_request + + def record! + if merge_request.merged? && self.merged_at.blank? + self.merged_at = Time.now + end + + self.save + end +end |