|
|
|
@ -9,6 +9,8 @@ class Ecs::SaveGraduationCourseSupportsService < ApplicationService
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def call
|
|
|
|
|
set_course_supports_position!
|
|
|
|
|
|
|
|
|
|
Ecs::SaveGraduationCourseSupportForm.new(params).validate!
|
|
|
|
|
|
|
|
|
|
accepts_attributes = build_accepts_nested_attributes(
|
|
|
|
@ -20,4 +22,10 @@ class Ecs::SaveGraduationCourseSupportsService < ApplicationService
|
|
|
|
|
graduation_subitem.save!
|
|
|
|
|
graduation_subitem
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def set_course_supports_position!
|
|
|
|
|
params[:course_supports].each_with_index do |item, index|
|
|
|
|
|
item[:position] = index + 1
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|