2020-06-23 00:09:42 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module AlertManagement
|
|
|
|
class AlertAssignee < ApplicationRecord
|
|
|
|
belongs_to :alert, inverse_of: :alert_assignees
|
2023-05-27 22:25:52 +05:30
|
|
|
belongs_to :assignee, class_name: 'User', foreign_key: :user_id, inverse_of: :alert_assignees
|
2020-06-23 00:09:42 +05:30
|
|
|
|
|
|
|
validates :alert, presence: true
|
|
|
|
validates :assignee, presence: true, uniqueness: { scope: :alert_id }
|
|
|
|
end
|
|
|
|
end
|