Add uniqueness for RunnerNamespace

This commit is contained in:
Kamil Trzciński 2018-05-28 14:36:47 +02:00 committed by Dylan Griffith
parent adc860ae0e
commit bf74e69eeb
1 changed files with 2 additions and 0 deletions

View File

@ -5,5 +5,7 @@ module Ci
belongs_to :runner, inverse_of: :runner_namespaces, validate: true
belongs_to :namespace, inverse_of: :runner_namespaces, class_name: '::Namespace'
belongs_to :group, class_name: '::Group', foreign_key: :namespace_id
validates :runner_id, uniqueness: { scope: :namespace_id }
end
end