Commit f32d4009 authored by Mark Chao's avatar Mark Chao

Fix sporadic spec failure on return order of approval rules

Sometimes the returned rule on single rule permission
can change due to not explicitly specify order by id.
parent beba8dea
......@@ -135,7 +135,7 @@ class ApprovalState
def regular_rules
strong_memoize(:regular_rules) do
rule_source = approval_rules_overwritten? ? merge_request : project
rules = rule_source.approval_rules.select(&:regular?)
rules = rule_source.approval_rules.select(&:regular?).sort_by(&:id)
unless project.feature_available?(:multiple_approval_rules)
rules = rules[0, 1]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment