eager_load

This commit is contained in:
yanxd 2014-07-10 15:39:40 +08:00
parent 249ea19c0c
commit e573438e43
1 changed files with 1 additions and 1 deletions

View File

@ -309,7 +309,7 @@ class UsersController < ApplicationController
# limit and offset
@users_statuses = @us_ordered.offset(@user_pages.offset).limit(@user_pages.per_page)
# get users ActiveRecord
@users = @users_statuses.map(&:user)
@users = @users_statuses.includes(:user).map(&:user)
@user_base_tag = params[:id] ? 'base_users':'base'
respond_to do |format|