|
|
|
@ -18,7 +18,7 @@ class StagesController < ApplicationController
|
|
|
|
|
@stage.position = @subject.stages.count + 1
|
|
|
|
|
@stage.save!
|
|
|
|
|
unless params[:shixun_id].blank?
|
|
|
|
|
shixuns = Shixun.where(id: params[:shixun_id])
|
|
|
|
|
shixuns = Shixun.where(id: params[:shixun_id]).order("field(id, #{params[:shixun_id].join(",")})")
|
|
|
|
|
shixuns.each do |shixun|
|
|
|
|
|
StageShixun.create!(stage_id: @stage.id, subject_id: @subject.id, shixun_id: shixun.id, position: @stage.stage_shixuns.count + 1)
|
|
|
|
|
end
|
|
|
|
|