# 批量屏蔽来自 /latest 的主题未按预期工作

**URL:** <https://meta.discourse.org/t/bulk-suppressing-topics-from-latest-not-working-as-expected/360279>\
**Category:** Support\
**Created:** [2025年四月3日 18:04 UTC](https://meta.discourse.org/t/bulk-suppressing-topics-from-latest-not-working-as-expected/360279 "2025-04-03T18:04:07Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![RGJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rgj/32/523185_2.png) [@RGJ](https://meta.discourse.org/u/RGJ)\
**Post date:** [2025年四月3日 22:34 UTC](https://meta.discourse.org/t/bulk-suppressing-topics-from-latest-not-working-as-expected/360279/4 "2025-04-03T22:34:07Z")

</div>

插件作者在此！

> [@huynhthai824](#):
>
> `cat.custom_fields["suppress_latest"] = true`

应该是

`cat.custom_fields[:suppress_category_from_latest] = true`

但是……这些值也缓存在一个类变量中。最简单的处理方法是也对分类进行 `save!`（参见 [此处](https://github.com/communiteq/discourse-suppress-category-from-latest/blob/master/plugin.rb#L16)）

所以这样可行

```plaintext
Category.all.each do |cat|
  cat.custom_fields[:suppress_category_from_latest] = true
  cat.save_custom_fields(true)
  cat.save!
end

```

---

_[View the full topic](https://meta.discourse.org/t/bulk-suppressing-topics-from-latest-not-working-as-expected/360279)._
