diff options
author | James Edwards-Jones <jedwardsjones@gitlab.com> | 2017-04-03 22:04:37 +0100 |
---|---|---|
committer | James Edwards-Jones <jedwardsjones@gitlab.com> | 2017-04-03 22:04:37 +0100 |
commit | ff2713a57046bd08764ad391d7f34bd27f787610 (patch) | |
tree | 89545571971411a3aa9a7deea61f08c2d9be0967 | |
parent | 3c91841d032f02b0b0d4c532998bbc923247e804 (diff) | |
download | gitlab-ce-ff2713a57046bd08764ad391d7f34bd27f787610.tar.gz |
Fix typos in ProtectedRef concern and whitespace detected by rubocop
4 files changed, 2 insertions, 5 deletions
diff --git a/app/controllers/projects/protected_branches_controller.rb b/app/controllers/projects/protected_branches_controller.rb index a245a60910e..c2a55c9500a 100644 --- a/app/controllers/projects/protected_branches_controller.rb +++ b/app/controllers/projects/protected_branches_controller.rb @@ -1,5 +1,4 @@ class Projects::ProtectedBranchesController < Projects::ProtectedRefsController - protected def protected_ref diff --git a/app/controllers/projects/protected_tags_controller.rb b/app/controllers/projects/protected_tags_controller.rb index 8f407b42ac8..ff132056aa4 100644 --- a/app/controllers/projects/protected_tags_controller.rb +++ b/app/controllers/projects/protected_tags_controller.rb @@ -1,5 +1,4 @@ class Projects::ProtectedTagsController < Projects::ProtectedRefsController - protected def protected_ref diff --git a/app/controllers/projects/settings/repository_controller.rb b/app/controllers/projects/settings/repository_controller.rb index fb175b4a636..ff818d9e51a 100644 --- a/app/controllers/projects/settings/repository_controller.rb +++ b/app/controllers/projects/settings/repository_controller.rb @@ -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 diff --git a/app/models/concerns/protected_ref.rb b/app/models/concerns/protected_ref.rb index 3681ae63e3a..f6841669ab0 100644 --- a/app/models/concerns/protected_ref.rb +++ b/app/models/concerns/protected_ref.rb @@ -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) |