diff options
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/merge_request.rb | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/app/models/merge_request.rb b/app/models/merge_request.rb index 4accb08eaf9..f6d4843abc3 100644 --- a/app/models/merge_request.rb +++ b/app/models/merge_request.rb @@ -989,13 +989,13 @@ class MergeRequest < ActiveRecord::Base merged_at = metrics&.merged_at notes_association = notes_with_associations - # It is not guaranteed that Note#created_at will be strictly later than - # MergeRequestMetric#merged_at. Nanoseconds on MySQL may break this - # comparison, as will a HA environment if clocks are not *precisely* - # synchronized. Add a minute's leeway to compensate for both possibilities - cutoff = merged_at - 1.minute - if merged_at + # It is not guaranteed that Note#created_at will be strictly later than + # MergeRequestMetric#merged_at. Nanoseconds on MySQL may break this + # comparison, as will a HA environment if clocks are not *precisely* + # synchronized. Add a minute's leeway to compensate for both possibilities + cutoff = merged_at - 1.minute + notes_association = notes_association.where('created_at >= ?', cutoff) end |