Fix notification created_at not being set for comment notifications

This commit is contained in:
Karina Kwiatek 2023-05-26 20:39:19 +02:00
parent d2dfe5239a
commit f1863e5309
1 changed files with 1 additions and 1 deletions

View File

@ -36,7 +36,7 @@ class Subscription < ApplicationRecord
.where.not(user: source.user) .where.not(user: source.user)
.where.not(user_id: muted_by) .where.not(user_id: muted_by)
.map do |s| .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 end
Notification.insert_all!(notifications) unless notifications.empty? # rubocop:disable Rails/SkipsModelValidations Notification.insert_all!(notifications) unless notifications.empty? # rubocop:disable Rails/SkipsModelValidations