instructure/canvas-lms — pull request #388 by ayanbule (2013-12-30 21:06:53+00:00)
Title: Pluck appointment ids in update_appointments

Issue:
When creating an appointment in the calendar, we get a "You can't specify target table 'calendar_events' for update in FROM clause" mysql error. The update_appointments after_save hook generates subqueries in the update statement.

We pre-select the appointment_ids instead of generating a sql sub-query.