Add static totalMessages() to Chat model.