From f1863e53091d3f5d3d73cfa8e4235594c9cf4234 Mon Sep 17 00:00:00 2001 From: Karina Kwiatek Date: Fri, 26 May 2023 20:39:19 +0200 Subject: [PATCH] Fix notification created_at not being set for comment notifications --- app/models/subscription.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/subscription.rb b/app/models/subscription.rb index 66520203..0b05a1b9 100644 --- a/app/models/subscription.rb +++ b/app/models/subscription.rb @@ -36,7 +36,7 @@ class Subscription < ApplicationRecord .where.not(user: source.user) .where.not(user_id: muted_by) .map do |s| - { target_id: source.id, target_type: Comment, recipient_id: s.user_id, new: true, type: Notification::Commented } + { target_id: source.id, target_type: Comment, recipient_id: s.user_id, new: true, type: Notification::Commented, created_at: source.created_at, updated_at: source.created_at } end Notification.insert_all!(notifications) unless notifications.empty? # rubocop:disable Rails/SkipsModelValidations