# Как получить владельцев группы? (Вопрос по коду Rails)

**URL:** <https://meta.discourse.org/t/how-to-retrieve-group-owners-rails-code-question/153610>\
**Category:** Development\
**Created:** [02.Июнь.2020 19:17:29 UTC](https://meta.discourse.org/t/how-to-retrieve-group-owners-rails-code-question/153610 "2020-06-02T19:17:29Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![tshenry](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tshenry/32/119495_2.png) [@tshenry](https://meta.discourse.org/u/tshenry)\
**Post date:** [03.Июнь.2020 00:34:41 UTC](https://meta.discourse.org/t/how-to-retrieve-group-owners-rails-code-question/153610/2 "2020-06-03T00:34:41Z")

</div>

Мне не совсем понятно, чего именно вы пытаетесь достичь, но, кажется, вам нужен [`GroupUser`](https://github.com/discourse/discourse/blob/master/app/models/group_user.rb). Вы можете получить список идентификаторов групп и идентификаторов пользователей их владельцев с помощью чего-то вроде:

```plaintext
GroupUser.where(owner: true).pluck("group_id", "user_id")

```

---

_[View the full topic](https://meta.discourse.org/t/how-to-retrieve-group-owners-rails-code-question/153610)._
