backport subqueries in array conditions from Rails 4 to Rails 3
backport subqueries in array conditions from Rails 4 to Rails 3

we've already backported it to Rails 2

Change-Id: Ibe8ff2f5263f524f9b899966e350dfac8cb3ba29
Reviewed-on: https://gerrit.instructure.com/28001
Reviewed-by: James Williams  <3a5f4ed991dbfa5c9ef76ad729d240ca12f62180@instructure.com>
Tested-by: Jenkins <d95b56ce41a2e1ac4cecdd398defd7414407cc08@instructure.com>
Reviewed-by: Anthus Williams <9b0bb6d8221e7e7c0d84e929f259a97887b2819e@instructure.com>
Reviewed-by: Jacob Fugal <f862f167b85d41b225785c70d70808bc7337c1fe@instructure.com>
QA-Review: Cody Cutrer <c4fe2b1d90ef8f2548c8aeabfa633434316f0305@instructure.com>
Product-Review: Cody Cutrer <c4fe2b1d90ef8f2548c8aeabfa633434316f0305@instructure.com>

Jyaasa/canvas-lms,snehakachroo1/LSI_replica,fronteerio/canvas-lms,antoniuslin/canvas-lms,leftplusrightllc/canvas-lms,wye0220/shindig-canvas,instructure/canvas-lms,dgynn/canvas-lms,djbender/canvas-lms,landonwilkins/canvas-lms,Unow/canvas-lms,landonwilkins/canvas-lms,samuels410/greatlakes-lms,wye0220/shindig-canvas,greyhwndz/canvas-lms,efrj/canvas-lms,sdeleon28/canvas-lms,Rvor/canvas-lms,djbender/canvas-lms,sdeleon28/canvas-lms,ShreniiNepal/shrenii_lmp,SwinburneOnline/canvas-lms,roxolan/canvas-lms,fronteerio/canvas-lms,AndranikMarkosyan/lms,utkarshx/canvas-lms,whalejasmine/canvas-lms,HotChalk/canvas-lms,Unow/canvas-lms,arrivu/arrivu-lms,kyroskoh/canvas-lms,Jyaasa/canvas-lms,greyhwndz/canvas-lms,antoniuslin/canvas-lms,venturehive/canvas-lms,skmezanul/canvas-lms,leftplusrightllc/canvas-lms,grahamb/canvas-lms,efrj/canvas-lms,whalejasmine/canvas-lms,Jyaasa/canvas-lms,Unow/canvas-lms,va7map/canvas-lms,sdeleon28/canvas-lms,utkarshx/canvas-lms,arrivu/arrivu-lms,djbender/canvas-lms,Jyaasa/canvas-lms,juoni/canvas-lms,venturehive/canvas-lms,sfu/canvas-lms,wrdsb/canvas-lms,sfu/canvas-lms,Rvor/canvas-lms,sfu/canvas-lms,leftplusrightllc/canvas-lms,HotChalk/canvas-lms,jay3126/canvas-lms,jay3126/canvas-lms,landonwilkins/canvas-lms,juoni/canvas-lms,matematikk-mooc/canvas-lms,djbender/canvas-lms,tgroshon/canvas-lms,juoni/canvas-lms,snehakachroo1/LSI_replica,dgynn/canvas-lms,tgroshon/canvas-lms,kyroskoh/canvas-lms,roxolan/canvas-lms,snehakachroo1/LSI_replica,shidao-fm/canvas-lms,grahamb/canvas-lms,gbleydon/canvas-lms,instructure/canvas-lms,sfu/canvas-lms,sdeleon28/canvas-lms,gbleydon/canvas-lms,gbleydon/canvas-lms,samuels410/greatlakes-lms,va7map/canvas-lms,Rvor/canvas-lms,eCNAP/CANVAS,kyroskoh/canvas-lms,shidao-fm/canvas-lms,dgynn/canvas-lms,SwinburneOnline/canvas-lms,whalejasmine/canvas-lms,HotChalk/canvas-lms,kyroskoh/canvas-lms,samuels410/greatlakes-lms,roxolan/canvas-lms,shidao-fm/canvas-lms,eCNAP/CANVAS,leftplusrightllc/canvas-lms,AndranikMarkosyan/lms,narigone/canvas,matematikk-mooc/canvas-lms,jay3126/canvas-lms,utkarshx/canvas-lms,sfu/canvas-lms,redconfetti/canvas-lms,efrj/canvas-lms,usmschuck/canvas,sfu/canvas-lms,eCNAP/CANVAS,narigone/canvas,AndranikMarkosyan/lms,greyhwndz/canvas-lms,redconfetti/canvas-lms,skmezanul/canvas-lms,wrdsb/canvas-lms,ShreniiNepal/shrenii_lmp,roxolan/canvas-lms,AndranikMarkosyan/lms,skmezanul/canvas-lms,instructure/canvas-lms,redconfetti/canvas-lms,tgroshon/canvas-lms,skmezanul/canvas-lms,snehakachroo1/LSI_replica,efrj/canvas-lms,arrivu/arrivu-lms,SwinburneOnline/canvas-lms,wrdsb/canvas-lms,wye0220/shindig-canvas,fronteerio/canvas-lms,instructure/canvas-lms,Rvor/canvas-lms,matematikk-mooc/canvas-lms,HotChalk/canvas-lms,usmschuck/canvas,va7map/canvas-lms,utkarshx/canvas-lms,jay3126/canvas-lms,greyhwndz/canvas-lms,fronteerio/canvas-lms,instructure/canvas-lms,tgroshon/canvas-lms,usmschuck/canvas,dgynn/canvas-lms,juoni/canvas-lms,sfu/canvas-lms,usmschuck/canvas,narigone/canvas,narigone/canvas,va7map/canvas-lms,matematikk-mooc/canvas-lms,antoniuslin/canvas-lms,ShreniiNepal/shrenii_lmp,whalejasmine/canvas-lms,instructure/canvas-lms,landonwilkins/canvas-lms,shidao-fm/canvas-lms,arrivu/hoodemo,arrivu/hoodemo,instructure/canvas-lms,venturehive/canvas-lms,grahamb/canvas-lms,venturehive/canvas-lms,arrivu/hoodemo,antoniuslin/canvas-lms,samuels410/greatlakes-lms,grahamb/canvas-lms,wrdsb/canvas-lms,eCNAP/CANVAS,SwinburneOnline/canvas-lms,grahamb/canvas-lms,ShreniiNepal/shrenii_lmp,redconfetti/canvas-lms