BigW Consortium Gitlab

metrics.rb 289 Bytes
Newer Older
1 2
class MergeRequest::Metrics < ActiveRecord::Base
  belongs_to :merge_request
3
  belongs_to :pipeline, class_name: 'Ci::Pipeline', foreign_key: :pipeline_id
4 5

  def record!
6 7 8 9
    if merge_request.merged? && self.merged_at.blank?
      self.merged_at = Time.now
    end

10
    self.save
11 12
  end
end