json.replies do
  json.array! messages do |message|
    arr = message.children.preload_messages.by_user(@current_user)
    json.total_count arr.size
    json.partial! "messages/message_detail", message: message
    json.partial! 'messages/list', messages: arr.ordered(sort: 1).limit(5)
  end
end
