diff options
author | James Edwards-Jones <jedwardsjones@gitlab.com> | 2017-05-05 16:59:31 +0100 |
---|---|---|
committer | James Edwards-Jones <jedwardsjones@gitlab.com> | 2017-05-31 13:06:29 +0100 |
commit | 0c1bf16d5f347da60bb84027db209ffc7b02f601 (patch) | |
tree | 630558c69aadd9fc9719dedd103bd5ad4c485634 /app/models/protected_branch.rb | |
parent | 19ee16a0f85dd4bacddbd066237e62a1bbb7113a (diff) | |
download | gitlab-ce-0c1bf16d5f347da60bb84027db209ffc7b02f601.tar.gz |
Backport EE refactorings for Protected Tag EE-only functionalityjej-backport-protected-tag-ee-role-refactorings
Improvements and refactorings were made while adding role based permissions for protected tags to EE. This doesn’t backport the feature, but should improve code quality and minimize divergence.
Diffstat (limited to 'app/models/protected_branch.rb')
-rw-r--r-- | app/models/protected_branch.rb | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/app/models/protected_branch.rb b/app/models/protected_branch.rb index 28b7d5ad072..5f0d0802ac9 100644 --- a/app/models/protected_branch.rb +++ b/app/models/protected_branch.rb @@ -2,14 +2,7 @@ class ProtectedBranch < ActiveRecord::Base include Gitlab::ShellAdapter include ProtectedRef - has_many :merge_access_levels, dependent: :destroy - has_many :push_access_levels, dependent: :destroy - - validates :merge_access_levels, length: { is: 1, message: "are restricted to a single instance per protected branch." } - validates :push_access_levels, length: { is: 1, message: "are restricted to a single instance per protected branch." } - - accepts_nested_attributes_for :push_access_levels - accepts_nested_attributes_for :merge_access_levels + protected_ref_access_levels :merge, :push # Check if branch name is marked as protected in the system def self.protected?(project, ref_name) |