mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-27 09:36:19 -05:00
FIX: Don't truncate groups. @ZogStrIP we need to create a better fix for
this in the new year.
This commit is contained in:
parent
36f53790f4
commit
35edfb5b91
2 changed files with 11 additions and 4 deletions
|
@ -19,9 +19,15 @@ class GroupsController < ApplicationController
|
|||
def members
|
||||
group = find_group(:group_id)
|
||||
|
||||
limit = (params[:limit] || 200).to_i
|
||||
offset = (params[:offset] || 0).to_i
|
||||
members = group.users.order('username_lower asc').limit(limit).offset(offset)
|
||||
members = group.users.order('username_lower asc')
|
||||
|
||||
# TODO: We should fix the root cause of the bug where if there
|
||||
# are more than 200 groups it will truncate
|
||||
if group.automatic?
|
||||
limit = (params[:limit] || 200).to_i
|
||||
offset = (params[:offset] || 0).to_i
|
||||
members = members.limit(limit).offset(offset)
|
||||
end
|
||||
|
||||
render_serialized(members.to_a, GroupUserSerializer)
|
||||
end
|
||||
|
|
|
@ -68,7 +68,8 @@ describe GroupsController do
|
|||
response.should be_success
|
||||
end
|
||||
|
||||
it "ensures that membership can be paginated" do
|
||||
# Pending until we fix group truncation
|
||||
pending "ensures that membership can be paginated" do
|
||||
5.times { group.add(Fabricate(:user)) }
|
||||
usernames = group.users.map{ |m| m['username'] }.sort
|
||||
|
||||
|
|
Loading…
Reference in a new issue