Replace inline SQL with Notification.unread scope
Replace inline SQL with Notification.private_messages scope
Replace inline SQL with Notification.latest scope
Replace Notification.recent scope with Notification.latest scope
Extract NotificationsDropdown#latest_notifications from notifications local variable
Move condition into NotificationsDropdown#latest_unread_private_messages
Replace notifications local variable with NotificationsDropdown#notifications
Move condition into NotificationsDropdown#mark_as_seen