gpt4 book ai didi

ruby-on-rails - 如何计算 Ruby on Rails 3 中的未读消息

转载 作者:行者123 更新时间:2023-12-04 06:09:39 24 4
gpt4 key购买 nike

我正在使用 gem mailboxer .
谁能告诉我如何计算收件箱中未读邮件的数量?

我试过:

<%= current_user.mailbox.inbox.unread.count %>

但是我明白了

'ArgumentError in Messages#received wrong number of arguments (0 for 1)'

最佳答案

0.10 版:

@user.mailbox.receipts.where(read:false).count

对于 0.11 版,我认为它会(虽然我还没有测试过)

@user.mailbox.receipts.where(is_read:false).count

关于ruby-on-rails - 如何计算 Ruby on Rails 3 中的未读消息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11560811/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com