# 交易按钮

**URL:** <https://meta.discourse.org/t/trading-buttons/71308>\
**Category:** Plugin\
**Created:** [2017年十月3日 11:01 UTC](https://meta.discourse.org/t/trading-buttons/71308 "2017-10-03T11:01:07Z")\
**Posts on this page:** 1\
**Showing post:** 46

<div class="post-metadata">

**Author:** ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)\
**Post date:** [2019年十二月11日 22:37 UTC](https://meta.discourse.org/t/trading-buttons/71308/46 "2019-12-11T22:37:17Z")

</div>

> [@Gunnar](#):
>
> 看起来该分类似乎对所有人都已静音。如何在 Rails 控制台中修复这个问题？

首先，请备份您的网站，以防出现问题。然后执行以下操作：

```ruby
# 获取分类并赋值给变量
c = Category.find_by(name: "<您的分类名称>")

# 为所有用户取消该分类的静音
CategoryUser.where(category_id: c.id, notification_level: 0).destroy_all

```

编辑：  
如果您想查看该分类在运行第二条命令前对多少用户处于静音状态，可以先运行：

```ruby
CategoryUser.where(category_id: c.id, notification_level: 0).count

```

这将返回已将该分类静音的用户数量。

---

_[View the full topic](https://meta.discourse.org/t/trading-buttons/71308)._
