Merge pull request #2698 from internetee/130-poll-message-crash--revised

Fix poll messages crashing
This commit is contained in:
Timo Võhmar 2024-10-17 13:24:20 +03:00 committed by GitHub
commit 97708f2476
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
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;
message = 'orphan message, domain deleted, registrar should dequeue: '
Rails.logger.error message + e.to_s
nil
end
# rubocop:enable Style/RescueStandardError

View file

@ -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,

View file

@ -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