Skip to content
Snippets Groups Projects
Commit 35b719f6 authored by James Edwards-Jones's avatar James Edwards-Jones
Browse files

Use delegation in ProtectedRef concern

parent 04a50bd9
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -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)
Loading
Loading
@@ -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
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment