Fix typos in ProtectedRef concern and whitespace detected by rubocop
This commit is contained in:
parent
3c91841d03
commit
ff2713a570
|
@ -1,5 +1,4 @@
|
|||
class Projects::ProtectedBranchesController < Projects::ProtectedRefsController
|
||||
|
||||
protected
|
||||
|
||||
def protected_ref
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
class Projects::ProtectedTagsController < Projects::ProtectedRefsController
|
||||
|
||||
protected
|
||||
|
||||
def protected_ref
|
||||
|
|
|
@ -19,7 +19,6 @@ module Projects
|
|||
load_gon_index
|
||||
end
|
||||
|
||||
|
||||
def access_levels_options
|
||||
#TODO: consider protected tags
|
||||
#TODO: Refactor ProtectedBranch::PushAccessLevel so it doesn't mention branches
|
||||
|
|
|
@ -9,13 +9,13 @@ module ProtectedRef
|
|||
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_levels_for_ref(ref, action: action).any? do |access_level|
|
||||
access_level.check_access(user)
|
||||
end
|
||||
end
|
||||
|
||||
def self.access_levels_for_ref(ref, action: :push)
|
||||
self.matching(ref).map(&:"@#{action}_access_levels").flatten
|
||||
self.matching(ref).map(&:"#{action}_access_levels").flatten
|
||||
end
|
||||
|
||||
def self.matching(ref_name, protected_refs: nil)
|
||||
|
|
Loading…
Reference in New Issue