diff options
Diffstat (limited to 'app/models/protected_branch.rb')
-rw-r--r-- | app/models/protected_branch.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/app/models/protected_branch.rb b/app/models/protected_branch.rb index 80967c1b072..c59ef4cd80b 100644 --- a/app/models/protected_branch.rb +++ b/app/models/protected_branch.rb @@ -14,10 +14,12 @@ class ProtectedBranch < ApplicationRecord scope :allowing_force_push, -> { where(allow_force_push: true) } - scope :get_ids_by_name, -> (name) { where(name: name).pluck(:id) } - protected_ref_access_levels :merge, :push + def self.get_ids_by_name(name) + where(name: name).pluck(:id) + end + def self.protected_ref_accessible_to?(ref, user, project:, action:, protected_refs: nil) # Maintainers, owners and admins are allowed to create the default branch |