/notes, /note_versions: fix N+1 queries on note creators, updaters.
This commit is contained in:
@@ -4,6 +4,7 @@ class NoteVersionsController < ApplicationController
|
||||
def index
|
||||
@note_versions = NoteVersion.search(params[:search]).order("note_versions.id desc").paginate(params[:page], :limit => params[:limit])
|
||||
respond_with(@note_versions) do |format|
|
||||
format.html { @note_versions = @note_versions.includes(:updater) }
|
||||
format.xml do
|
||||
render :xml => @note_versions.to_xml(:root => "note-versions")
|
||||
end
|
||||
|
||||
@@ -8,6 +8,7 @@ class NotesController < ApplicationController
|
||||
def index
|
||||
@notes = Note.search(params[:search]).order("id desc").paginate(params[:page], :limit => params[:limit], :search_count => params[:search])
|
||||
respond_with(@notes) do |format|
|
||||
format.html { @notes = @notes.includes(:creator) }
|
||||
format.xml do
|
||||
render :xml => @notes.to_xml(:root => "notes")
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user