Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

add appointment group preloads

refs CNVS-4561

test plan
-make sure scheduler works as before

Change-Id: Ie310af56f716aea1fadac9a2b0ad41481b38ed77
Reviewed-on: https://gerrit.instructure.com/19329
Reviewed-by: Zach Pendleton <zachp@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
Product-Review: Zach Pendleton <zachp@instructure.com>
  • Loading branch information...
commit 0cc6857472b951d409e0c4319cbf7d506a363268 1 parent 8aefb86
@JoelHough JoelHough authored zachpendleton committed
Showing with 17 additions and 2 deletions.
  1. +17 −2 app/controllers/appointment_groups_controller.rb
View
19 app/controllers/appointment_groups_controller.rb
@@ -156,8 +156,23 @@ def index
self,
api_v1_appointment_groups_url(:scope => params[:scope])
)
- AppointmentGroup.send(:preload_associations, groups, :appointments) if params[:include]
- render :json => groups.map{ |group| appointment_group_json(group, @current_user, session, :include => params[:include]) }
+ if params[:include]
+ AppointmentGroup.send(:preload_associations, groups,
+ [{:appointments =>
+ [:parent_event,
+ {:context =>
+ [{:appointment_group_contexts => :context},
+ :appointment_group_sub_contexts]},
+ {:child_events =>
+ [:parent_event,
+ :context,
+ {:child_events =>
+ [:parent_event,
+ :context]}]}]},
+ {:appointment_group_contexts => :context},
+ :appointment_group_sub_contexts])
+ end
+ render :json => groups.map{ |group| appointment_group_json(group, @current_user, session, :include => params[:include]) }
end
# @API Create an appointment group
Please sign in to comment.
Something went wrong with that request. Please try again.