diff options
Diffstat (limited to 'app/models/ci/instance_variable.rb')
-rw-r--r-- | app/models/ci/instance_variable.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/app/models/ci/instance_variable.rb b/app/models/ci/instance_variable.rb new file mode 100644 index 00000000000..19511696509 --- /dev/null +++ b/app/models/ci/instance_variable.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Ci + class InstanceVariable < ApplicationRecord + extend Gitlab::Ci::Model + include Ci::NewHasVariable + include Ci::Maskable + + alias_attribute :secret_value, :value + + validates :key, uniqueness: { + message: "(%{value}) has already been taken" + } + + scope :unprotected, -> { where(protected: false) } + end +end |