Skip to content

Commit

Permalink
Merge pull request #2698 from internetee/130-poll-message-crash--revised
Browse files Browse the repository at this point in the history
Fix poll messages crashing
  • Loading branch information
vohmar authored Oct 17, 2024
2 parents bc49c16 + ce01b08 commit 97708f2
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/controllers/repp/v1/registrar/summary_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions app/models/action.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions app/models/notification.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 97708f2

Please sign in to comment.