fix preload and eager load with join-dependent conditions for rails 3

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