BigW Consortium Gitlab

variable.rb 356 Bytes
Newer Older
1 2
module Ci
  class Variable < ActiveRecord::Base
3
    extend Gitlab::Ci::Model
Shinya Maeda committed
4
    include HasVariable
Shinya Maeda committed
5
    include Presentable
6

7
    belongs_to :project
8

9 10 11 12
    validates :key, uniqueness: {
      scope: [:project_id, :environment_scope],
      message: "(%{value}) has already been taken"
    }
13

14
    scope :unprotected, -> { where(protected: false) }
15 16
  end
end