diff options
author | Douwe Maan <douwe@selenight.nl> | 2016-11-23 15:00:58 +0300 |
---|---|---|
committer | Douwe Maan <douwe@selenight.nl> | 2016-11-23 15:02:14 +0300 |
commit | f2a0c6f6bf768db8837283ad65fe6790b9105d26 (patch) | |
tree | 069462cbabd3e24e4fbd15bbfa65865a5c19c21f /app/models | |
parent | d0c0c75ca9568bc3ec00c341a6053623d85e6201 (diff) |
Correctly determine mergeability of MR with no discussions
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/merge_request.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/app/models/merge_request.rb b/app/models/merge_request.rb index 6c3c093d084..fdf54cc8a7e 100644 --- a/app/models/merge_request.rb +++ b/app/models/merge_request.rb @@ -494,10 +494,14 @@ class MergeRequest < ActiveRecord::Base discussions_resolvable? && diff_discussions.none?(&:to_be_resolved?) end + def discussions_to_be_resolved? + discussions_resolvable? && !discussions_resolved? + end + def mergeable_discussions_state? return true unless project.only_allow_merge_if_all_discussions_are_resolved? - discussions_resolved? + !discussions_to_be_resolved? end def hook_attrs |