From a7332846df975cdd685ac98eb87a0c91d8dc5c95 Mon Sep 17 00:00:00 2001 From: Anna Buianova Date: Fri, 31 May 2019 14:30:17 +0300 Subject: [PATCH] Validate on creating a reaction notification (#3010) --- app/services/notifications/reactions/send.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/services/notifications/reactions/send.rb b/app/services/notifications/reactions/send.rb index 8029b3ed0..9a9cbf077 100644 --- a/app/services/notifications/reactions/send.rb +++ b/app/services/notifications/reactions/send.rb @@ -55,7 +55,10 @@ module Notifications notification.notified_at = Time.current notification.read = false if json_data[:reaction][:aggregated_siblings].size > previous_siblings_size - notification_id = save_notification(notification) + # temporarily returning validations to prevent creating duplicate notifications + # notification_id = save_notification(notification) + notification.save! + notification_id = notification.id OpenStruct.new(action: :saved, notification_id: notification_id) end