FIX: Incorrect notification state being published.

This commit is contained in:
Guo Xiang Tan
2017-09-15 16:18:30 +08:00
parent 23b787e0a6
commit e542884b00
2 changed files with 21 additions and 3 deletions

View File

@ -405,9 +405,11 @@ class User < ActiveRecord::Base
) AS y
"
recent = User.exec_sql(sql, user_id: id,
type: Notification.types[:private_message]).values.map do |id, read|
[id.to_i, read == 't'.freeze]
recent = User.exec_sql(sql,
user_id: id,
type: Notification.types[:private_message]
).values.map! do |id, read|
[id.to_i, read]
end
MessageBus.publish("/notification/#{id}",