How to retrieve group owners? (Rails code question)

Sure :slight_smile: The data isn’t exposed by default in the BasicGroupSerializer. We only include what we need.

It’s a bit of a maze to follow, but the only reason the groups-info component has what it has available is because it’s passed group from it’s parent template:

https://github.com/discourse/discourse/blob/d3c972c30cafb8ca595a60233a30f75b2f95336c/app/assets/javascripts/discourse/app/templates/groups/index.hbs#L53-L53

And the parent template gets it from the controller:

https://github.com/discourse/discourse/blob/d3c972c30cafb8ca595a60233a30f75b2f95336c/app/assets/javascripts/discourse/app/controllers/groups-index.js#L37-L37

I’m afraid not. Unless there’s some magic I’m not aware of!

2 Likes