Use through-relation instead of manually mapping.
This commit is contained in:
parent
ff3caad4ca
commit
e6569defe6
1 changed files with 1 additions and 2 deletions
|
@ -9,8 +9,7 @@ module API
|
|||
# GET /groups/:id/members
|
||||
get ":id/members" do
|
||||
group = find_group(params[:id])
|
||||
members = group.group_members
|
||||
users = (paginate members).collect(&:user)
|
||||
users = group.users
|
||||
present users, with: Entities::GroupMember, group: group
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue