mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-05-11 01:05:01 -04:00
Mark read notifications as read after migrating to conversations
This commit is contained in:
@@ -7,7 +7,7 @@ Mailboxer.setup do |config|
|
||||
|
||||
# Configures the methods needed by mailboxer
|
||||
# config.email_method = :email
|
||||
# config.name_method = :login_name
|
||||
config.name_method = :login_name
|
||||
config.notify_method = :notify
|
||||
|
||||
# Configures if you use or not a search engine and which one you are using
|
||||
|
||||
@@ -7,7 +7,10 @@ class NotificationsToMailboxer < ActiveRecord::Migration[5.2]
|
||||
Notification.find_in_batches.each do |group|
|
||||
group.each do |n|
|
||||
n.body = 'message has no body' if n.body.blank?
|
||||
n.send_message
|
||||
receipt = n.send_message
|
||||
next unless n.read
|
||||
|
||||
receipt.conversation.receipts.each(&:mark_as_read)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user