diff --git a/app/models/user_assignment.rb b/app/models/user_assignment.rb index fda354e47..4f21d82e5 100644 --- a/app/models/user_assignment.rb +++ b/app/models/user_assignment.rb @@ -7,4 +7,6 @@ class UserAssignment < ApplicationRecord belongs_to :assigned_by, class_name: 'User', optional: true enum assigned: { automatically: 0, manually: 1 }, _suffix: true + + validates :user, uniqueness: { scope: :assignable } end