Fix poll messages crashing

This commit is contained in:
tsoganov 2024-10-15 15:13:46 +03:00
parent 4f2c29f6a3
commit ce01b0847c
3 changed files with 3 additions and 0 deletions

View file

@ -59,6 +59,7 @@ module Repp
# WHERE attached_obj_type = 'Epp::Domain' AND name IS NULL; # WHERE attached_obj_type = 'Epp::Domain' AND name IS NULL;
message = 'orphan message, domain deleted, registrar should dequeue: ' message = 'orphan message, domain deleted, registrar should dequeue: '
Rails.logger.error message + e.to_s Rails.logger.error message + e.to_s
nil
end end
# rubocop:enable Style/RescueStandardError # rubocop:enable Style/RescueStandardError

View file

@ -3,6 +3,7 @@ class Action < ApplicationRecord
belongs_to :user belongs_to :user
belongs_to :contact, optional: true belongs_to :contact, optional: true
has_many :notifications, dependent: :nullify
has_many :subactions, class_name: 'Action', has_many :subactions, class_name: 'Action',
foreign_key: 'bulk_action_id', foreign_key: 'bulk_action_id',
inverse_of: :bulk_action, inverse_of: :bulk_action,

View file

@ -13,6 +13,7 @@ class Notification < ApplicationRecord
def mark_as_read def mark_as_read
raise 'Read notification cannot be marked as read again' if read? raise 'Read notification cannot be marked as read again' if read?
self.read = true self.read = true
save save
end end