Commit 35b719f6 authored by James Edwards-Jones's avatar James Edwards-Jones

Use delegation in ProtectedRef concern

parent 04a50bd9
......@@ -6,6 +6,8 @@ module ProtectedRef
validates :name, presence: true
validates :project, presence: true
delegate :matching, :matches?, :wildcard?, to: :ref_matcher
def self.matching_refs_accesible_to(ref, user, action: :push)
access_levels_for_ref(ref, action).any? do |access_level|
access_level.check_access(user)
......@@ -27,18 +29,6 @@ module ProtectedRef
project.commit(self.name)
end
def matching(refs)
ref_matcher.matching(refs)
end
def matches?(refs)
ref_matcher.matches?(refs)
end
def wildcard?
ref_matcher.wildcard?
end
private
def ref_matcher
......
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