From f41afbe27f5f5d1441c1ee9c8965fee15b7a96b0 Mon Sep 17 00:00:00 2001 From: dankmitchell Date: Fri, 27 Dec 2019 13:01:21 +0000 Subject: [PATCH] [2339] Fix up course v3 endpoint for subjects --- app/controllers/api/v3/courses_controller.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/controllers/api/v3/courses_controller.rb b/app/controllers/api/v3/courses_controller.rb index 1f5779f75a..3bb3520eec 100644 --- a/app/controllers/api/v3/courses_controller.rb +++ b/app/controllers/api/v3/courses_controller.rb @@ -13,7 +13,8 @@ def show @course = @provider.courses.find_by!(course_code: params[:code].upcase) if @course.is_published? - render jsonapi: @course, fields: fields_param, include: params[:include] + # https://github.com/jsonapi-rb/jsonapi-rails/issues/113 + render jsonapi: @course, fields: fields_param, include: params[:include], class: CourseSerializersService.new.execute else raise ActiveRecord::RecordNotFound end