Skip to content

Commit

Permalink
Merge pull request #310 from coopdevs/fix/users-list-sorting
Browse files Browse the repository at this point in the history
Fix users list sorting
  • Loading branch information
sauloperez authored Jan 30, 2018
2 parents 3708648 + 2d3bb1c commit 6660a79
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/controllers/users_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@ class UsersController < ApplicationController
before_filter :authenticate_user!

def index
@search = current_organization.users.ransack(params[:q])
@search = User.ransack(params[:q])
@search.sorts = 'members_member_uid asc' if @search.sorts.empty?

@users = @search
.result(distinct: false)
.joins(members: :account)
.eager_load(members: :account)
.where(members: { organization: current_organization.id })
.page(params[:page])
.per(25)

Expand Down

0 comments on commit 6660a79

Please sign in to comment.