Added eager load to admin contact index

This commit is contained in:
Priit Tark 2015-03-31 16:50:47 +03:00
parent c6c58b177a
commit 42604daf69

View file

@ -3,7 +3,7 @@ class Admin::ContactsController < AdminController
before_action :set_contact, only: [:show]
def index
@q = Contact.search(params[:q])
@q = Contact.includes(:registrar).search(params[:q])
@contacts = @q.result.page(params[:page])
end