提交 41551791 编写于 作者: D DJ Mountney

Update merge_status state to allow more transitions

Previously you could only transition from the unchecked state to one of the others. This meant that the mark_as_unmerged call in AutoMergeService would rarily be able to actually transition the state. As it would usually have already been set to can_be_merged before it hit that service.
上级 476199e0
...@@ -95,11 +95,11 @@ class MergeRequest < ActiveRecord::Base ...@@ -95,11 +95,11 @@ class MergeRequest < ActiveRecord::Base
end end
event :mark_as_mergeable do event :mark_as_mergeable do
transition unchecked: :can_be_merged transition [:unchecked, :cannot_be_merged] => :can_be_merged
end end
event :mark_as_unmergeable do event :mark_as_unmergeable do
transition unchecked: :cannot_be_merged transition [:unchecked, :can_be_merged] => :cannot_be_merged
end end
state :unchecked state :unchecked
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册