|
|
|
@ -36,18 +36,20 @@ class Ecs::RequirementSupportObjectivesController < Ecs::BaseController
|
|
|
|
|
private
|
|
|
|
|
|
|
|
|
|
def check_record_exists!
|
|
|
|
|
unless current_year.ec_graduation_requirements.exists?(id: params[:graduation_requirement_id])
|
|
|
|
|
unless current_year.ec_graduation_requirements.exists?(id: params[:ec_graduation_requirement_id])
|
|
|
|
|
render_not_found
|
|
|
|
|
return
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
unless current_year.ec_training_subitems.exists?(id: params[:training_subitem_id])
|
|
|
|
|
unless current_year.ec_training_subitems.exists?(id: params[:ec_training_subitem_id])
|
|
|
|
|
render_not_found
|
|
|
|
|
return
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def permit_params
|
|
|
|
|
params.require(%i[ec_graduation_requirement_id ec_training_subitem_id])
|
|
|
|
|
hash = params.permit(%i[ec_graduation_requirement_id ec_training_subitem_id])
|
|
|
|
|
hash[:ec_training_objective_id] = hash.delete(:ec_training_subitem_id)
|
|
|
|
|
hash
|
|
|
|
|
end
|
|
|
|
|
end
|