dev_forum
cxt 5 years ago
parent f8ba7399df
commit 4032174a10

@ -65,11 +65,11 @@ class SubjectsController < ApplicationController
@total_count = @subjects.size @total_count = @subjects.size
if reorder != "myshixun_count" if reorder != "myshixun_count"
@subjects = @subjects.page(page).per(limit).includes(:shixuns) @subjects = @subjects.page(page).per(limit).includes(:shixuns, :repertoire)
else else
@subjects = @subjects[offset, limit] @subjects = @subjects[offset, limit]
subject_ids = @subjects.pluck(:id) subject_ids = @subjects.pluck(:id)
@subjects = Subject.where(id: subject_ids).order("field(id,#{subject_ids.join(',')})").includes(:shixuns) @subjects = Subject.where(id: subject_ids).order("field(id,#{subject_ids.join(',')})").includes(:shixuns, :repertoire)
end end
end end

Loading…
Cancel
Save