metrics.rb 289 Bytes EditWeb IDE 1 2 3 4 5 6 7 8 9 10 11 12 class MergeRequest::Metrics < ActiveRecord::Base belongs_to :merge_request belongs_to :pipeline, class_name: 'Ci::Pipeline', foreign_key: :pipeline_id def record! if merge_request.merged? && self.merged_at.blank? self.merged_at = Time.now end self.save end end