debian-mirror-gitlab/app/models/protected_tag.rb

13 lines
293 B
Ruby
Raw Normal View History

2017-08-17 22:00:37 +05:30
class ProtectedTag < ActiveRecord::Base
include Gitlab::ShellAdapter
include ProtectedRef
2017-09-10 17:25:29 +05:30
protected_ref_access_levels :create
2017-08-17 22:00:37 +05:30
def self.protected?(project, ref_name)
2018-03-17 18:26:18 +05:30
refs = project.protected_tags.select(:name)
self.matching(ref_name, protected_refs: refs).present?
2017-08-17 22:00:37 +05:30
end
end