2016-09-29 09:46:39 +05:30
|
|
|
class MergeRequest::Metrics < ActiveRecord::Base
|
|
|
|
belongs_to :merge_request
|
2017-08-17 22:00:37 +05:30
|
|
|
belongs_to :pipeline, class_name: 'Ci::Pipeline', foreign_key: :pipeline_id
|
2016-09-29 09:46:39 +05:30
|
|
|
|
|
|
|
def record!
|
|
|
|
if merge_request.merged? && self.merged_at.blank?
|
|
|
|
self.merged_at = Time.now
|
|
|
|
end
|
|
|
|
|
|
|
|
self.save
|
|
|
|
end
|
|
|
|
end
|