fix update/delete with multiple joins in rails 3

Change-Id: I1aece03c2d7b25c9e98013f00d2f984dee0a3444
Reviewed-on: https://gerrit.instructure.com/39006
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: James Williams  <jamesw@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>