diff options
Diffstat (limited to 'app/graphql/resolvers/projects/branch_rules_resolver.rb')
-rw-r--r-- | app/graphql/resolvers/projects/branch_rules_resolver.rb | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/app/graphql/resolvers/projects/branch_rules_resolver.rb b/app/graphql/resolvers/projects/branch_rules_resolver.rb index e99d7ae4d5f..d1b39df602f 100644 --- a/app/graphql/resolvers/projects/branch_rules_resolver.rb +++ b/app/graphql/resolvers/projects/branch_rules_resolver.rb @@ -10,7 +10,15 @@ module Resolvers alias_method :project, :object def resolve_with_lookahead(**args) - apply_lookahead(project.protected_branches) + protected_branches.map do |protected_branch| + ::Projects::BranchRule.new(project, protected_branch) + end + end + + private + + def protected_branches + apply_lookahead(project.protected_branches.sorted_by_name) end end end |