diff --git a/app/controllers/repp/v1/registrar/summary_controller.rb b/app/controllers/repp/v1/registrar/summary_controller.rb index eaa3b0f577..7b5ddc934c 100644 --- a/app/controllers/repp/v1/registrar/summary_controller.rb +++ b/app/controllers/repp/v1/registrar/summary_controller.rb @@ -59,6 +59,7 @@ def notification_object(notification) # WHERE attached_obj_type = 'Epp::Domain' AND name IS NULL; message = 'orphan message, domain deleted, registrar should dequeue: ' Rails.logger.error message + e.to_s + nil end # rubocop:enable Style/RescueStandardError diff --git a/app/models/action.rb b/app/models/action.rb index 03c8e9fe83..cf214851e1 100644 --- a/app/models/action.rb +++ b/app/models/action.rb @@ -3,6 +3,7 @@ class Action < ApplicationRecord belongs_to :user belongs_to :contact, optional: true + has_many :notifications, dependent: :nullify has_many :subactions, class_name: 'Action', foreign_key: 'bulk_action_id', inverse_of: :bulk_action, diff --git a/app/models/notification.rb b/app/models/notification.rb index 8cb4335a2f..ff0d669b84 100644 --- a/app/models/notification.rb +++ b/app/models/notification.rb @@ -13,6 +13,7 @@ class Notification < ApplicationRecord def mark_as_read raise 'Read notification cannot be marked as read again' if read? + self.read = true save end