|
|
|
@ -69,7 +69,8 @@ class SubjectsController < ApplicationController
|
|
|
|
|
else
|
|
|
|
|
@subjects = @subjects[offset, limit]
|
|
|
|
|
subject_ids = @subjects.pluck(:id)
|
|
|
|
|
@subjects = Subject.where(id: subject_ids).order("field(id,#{subject_ids.join(',')})").includes(:shixuns, :repertoire)
|
|
|
|
|
order_ids = subject_ids.size > 0 ? subject_ids.join(',') : -1
|
|
|
|
|
@subjects = Subject.where(id: subject_ids).order("field(id,#{order_ids})").includes(:shixuns, :repertoire)
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|