Commit 501f0f23 authored by Mark Chao's avatar Mark Chao

Consolidate forwarding for approvers_overwritten?

parent a5f4b8bd
......@@ -38,6 +38,7 @@ class ApprovalState
def approval_rules_overwritten?
merge_request.approval_rules.regular.exists?
end
alias_method :approvers_overwritten?, :approval_rules_overwritten?
def approval_needed?
return false unless project.feature_available?(:merge_request_approvers)
......
......@@ -11,6 +11,7 @@ module ApprovableForRule
has_approved?
any_approver_allowed?
authors_can_approve?
approvers_overwritten?
}.freeze
FORWARDABLE_METHODS.each do |method|
......@@ -20,10 +21,4 @@ module ApprovableForRule
approval_state.public_send(method, *args) # rubocop:disable GitlabSecurity/PublicSend
end
end
def approvers_overwritten?
return super if ::Feature.disabled?(:approval_rules, project)
approval_state.approval_rules_overwritten?
end
end
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