# すべてのグループを更新してアンロックする方法はどのように？

**URL:** https://meta.discourse.org/t/how-to-update-and-unlock-all-groups/260504
**Category:** Support
**Created:** [2023 年 4 月 4 日午前 8:24 UTC](https://meta.discourse.org/t/how-to-update-and-unlock-all-groups/260504 "2023-04-04T08:24:58Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![satonotdead](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/satonotdead/32/447830_2.png) [@satonotdead](https://meta.discourse.org/u/satonotdead)
#### Post date: [2023 年 4 月 4 日午前 8:24 UTC](https://meta.discourse.org/t/how-to-update-and-unlock-all-groups/260504/1 "2023-04-04T08:24:58Z")

</div>

TL3でロックされたグループを使用していたのですが、(Discordを離れ、フォーラムでのエンゲージメントを高める必要があるため) デフォルトの信頼レベルシステムに再度移行することになりました。

1. すべてのTLをアンロックし、すべてのユーザーをTL設定に合わせるにはどうすればよいですか？
2. グループでTLを更新するにはどうすればよいですか？TL3アクセス権を持つグループにロックされていないTL1のユーザーがいます。

> いくつかのクエリを試しましたが、(4年以上前のもので) 古いようです。

---

<div class="post-metadata">

### Author: ![nathank](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nathank/32/290039_2.png) [@nathank](https://meta.discourse.org/u/nathank)
#### Post date: [2023 年 4 月 4 日午前 9:43 UTC](https://meta.discourse.org/t/how-to-update-and-unlock-all-groups/260504/2 "2023-04-04T09:43:47Z")

</div>

UIでグループのTLを変更するのが最も簡単な方法ですが、大量にある場合はRailsコンソールで特定することもできます。

信頼レベルをリセットするには、次のガイドを参照してください。

[https://meta.discourse.org/t/administrative-bulk-operations/118349#ensure-all-users-are-at-their-automatic-trust-level-18](https://meta.discourse.org/t/administrative-bulk-operations/118349#ensure-all-users-are-at-their-automatic-trust-level-18)

警告：これにより、全員が最初からやり直しになります。

---

<div class="post-metadata">

### Author: ![satonotdead](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/satonotdead/32/447830_2.png) [@satonotdead](https://meta.discourse.org/u/satonotdead)
#### Post date: [2023 年 4 月 4 日午前 10:04 UTC](https://meta.discourse.org/t/how-to-update-and-unlock-all-groups/260504/3 "2023-04-04T10:04:52Z")

</div>

> [@nathankershaw](#):
>
> 注意してください。全員が最初からやり直すことになります。

~~TLシステムをリセットして尊重し、すべてのユーザーをデフォルト設定から再配置することはできませんか？~~

それは（あなたがリンクした投稿から）期待される動作のようです。したがって、Railsから全員のTLを解除する方法だけが必要です:)

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [2023 年 4 月 4 日午前 11:05 UTC](https://meta.discourse.org/t/how-to-update-and-unlock-all-groups/260504/4 "2023-04-04T11:05:10Z")

</div>

`Group.last` を使用して、グループモデルがどのようになっているかを確認します。または、特定のグループを確認するには `Group.find_by_slug("some_slug")` を使用します。変更されたものとそうでないものを確認できます。

その後、`Group.all.update_all(field: value)` を実行して、すべてを設定できます。

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [2023 年 6 月 8 日午前 10:22 UTC](https://meta.discourse.org/t/how-to-update-and-unlock-all-groups/260504/6 "2023-06-08T10:22:04Z")

</div>

このトピックで必要なものは見つかりましたか @satonotdead?

> [@List of users with locked trust level due to group membership?](https://meta.discourse.org/t/list-of-users-with-locked-trust-level-due-to-group-membership/62455/24?u=jammydodger):
>
> That’s do the trick! SELECT username from users WHERE manual\_locked\_trust\_level = 1
