codeforamerica/brigade — pull request #160 by michaelsergio (2013-04-24 06:32:41+00:00)
Title: Faster members page

This is a band-aid fix for issue #153.
The main problem is an N+1 query in the user index view. It calls for user.location in a loop causes some 1800 SELECT queries to be executed. My fix includes the user's locations in the UserController#index method.

This should definitely make the query faster, but it doesn't address the overall problem. The members page is kind of pointless right now. The biggest feature is probably the search bar and you have to wait for all the users to load. It may be a better solution just to have Kaminari paginate the users.