diff options
author | Douwe Maan <douwe@gitlab.com> | 2015-04-15 09:50:46 +0000 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2015-04-15 09:50:46 +0000 |
commit | b409c376711f7130f20ded5732354b66428a2674 (patch) | |
tree | a698c247eb9c234f24cadd01633fd52643273389 | |
parent | 63b21945d2a6d53c7baa65bffcac33ab5fa8bb91 (diff) | |
parent | f517dd2606e6d49a447cc952bd4b16ce017f1ddc (diff) | |
download | gitlab-ce-b409c376711f7130f20ded5732354b66428a2674.tar.gz |
Merge branch 'fix-stuck-mr' into 'master'
fix stuck mr
If `locked?` & `locked_at.nil?` is nil return that the merge has been locked long enough and those are old merges stuck in locked state.
Fixes #348. Related to 6487419364fa9c179e24028d85b2be10d574067f. Replaces !517.
/cc @DouweM
See merge request !526
-rw-r--r-- | CHANGELOG | 1 | ||||
-rw-r--r-- | app/models/merge_request.rb | 4 |
2 files changed, 4 insertions, 1 deletions
diff --git a/CHANGELOG b/CHANGELOG index 0ecde5ef89c..4d022bdc62b 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -76,6 +76,7 @@ v 7.10.0 (unreleased) - Bust group page project list cache when namespace name or path changes. - Explicitly set image alt-attribute to prevent graphical glitches if gravatars could not be loaded - Allow user to choose a public email to show on public profile + - Fix stuck Merge Request merging events from old installations (Ben Bodenmiller) v 7.9.3 - Contains no changes diff --git a/app/models/merge_request.rb b/app/models/merge_request.rb index 35cb920d8bc..9c9e2762507 100644 --- a/app/models/merge_request.rb +++ b/app/models/merge_request.rb @@ -361,6 +361,8 @@ class MergeRequest < ActiveRecord::Base end def locked_long_ago? - locked_at && locked_at < (Time.now - 1.day) + return false unless locked? + + locked_at.nil? || locked_at < (Time.now - 1.day) end end |