Fix weird Rubocop error.

This commit is contained in:
Guo Xiang Tan 2017-10-23 12:30:28 +08:00
parent 509ecbe9fb
commit d5e369d6cf

View File

@ -19,12 +19,16 @@ module Jobs
count = query.count count = query.count
if count > 0 if count > 0
target_usernames = Group[:moderators].users.map do |u| target_usernames = Group[:moderators].users.map do |user|
u.id > 0 && u.notifications.joins(:topic) next if user.id < 0
.where("notifications.id > ?", u.seen_notification_id)
count = user.notifications.joins(:topic)
.where("notifications.id > ?", user.seen_notification_id)
.where("notifications.read = false") .where("notifications.read = false")
.where("topics.subtype = '#{TopicSubtype.pending_users_reminder}'") .where("topics.subtype = ?", TopicSubtype.pending_users_reminder)
.count == 0 ? u.username : nil .count
count == 0 ? user.username : nil
end.compact end.compact
unless target_usernames.empty? unless target_usernames.empty?