From 0c1bf16d5f347da60bb84027db209ffc7b02f601 Mon Sep 17 00:00:00 2001 From: James Edwards-Jones Date: Fri, 5 May 2017 16:59:31 +0100 Subject: Backport EE refactorings for Protected Tag EE-only functionality MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- app/models/protected_tag.rb | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'app/models/protected_tag.rb') diff --git a/app/models/protected_tag.rb b/app/models/protected_tag.rb index 83964095516..f38109c0e52 100644 --- a/app/models/protected_tag.rb +++ b/app/models/protected_tag.rb @@ -2,11 +2,7 @@ class ProtectedTag < ActiveRecord::Base include Gitlab::ShellAdapter include ProtectedRef - has_many :create_access_levels, dependent: :destroy - - validates :create_access_levels, length: { is: 1, message: "are restricted to a single instance per protected tag." } - - accepts_nested_attributes_for :create_access_levels + protected_ref_access_levels :create def self.protected?(project, ref_name) self.matching(ref_name, protected_refs: project.protected_tags).present? -- cgit v1.2.3