use named scope to avoid postgres warning
use named scope to avoid postgres warning

Change-Id: I9ef84d815ddf059ae0244977af250eb39d1b6c85
Reviewed-on: https://gerrit.instructure.com/3486
Tested-by: Hudson <dfb64870173313a9a7b56f814c8e3b33e268497a@instructure.com>
Reviewed-by: Jon Jensen <44f878afe53efc66b76772bd845eb65944ed8232@instructure.com>

arrivu/hoodemo,matematikk-mooc/canvas-lms,fronteerio/canvas-lms,efrj/canvas-lms,rup/Tarrax,sfu/canvas-lms,efrj/canvas-lms,gbleydon/canvas-lms,redconfetti/canvas-lms,SwinburneOnline/canvas-lms,ottenhoff/canvas-lms,sdeleon28/canvas-lms,nditech/red-innovadores-lms,efrj/canvas-lms,djbender/canvas-lms,dgynn/canvas-lms,arrivu/jigsaw-lms,antoniuslin/canvas-lms,shidao-fm/canvas-lms,arrivu/arrivu-lms,landonwilkins/canvas-lms,samuels410/greatlakes-lms,eCNAP/CANVAS,usmschuck/canvas,kyroskoh/canvas-lms,utkarshx/canvas-lms,narigone/canvas,eCNAP/CANVAS,parbros/red-innovadores-lms,arrivu/qibla-ecampus,Jyaasa/canvas-lms,icelab/canvas,snehakachroo1/LSI_replica,sdeleon28/canvas-lms,Jyaasa/canvas-lms,utkarshx/canvas-lms,arrivu/hiring-site,wrdsb/canvas-lms,dgynn/canvas-lms,tgroshon/canvas-lms,tgroshon/canvas-lms,jay3126/canvas-lms,instructure/canvas-lms,grahamb/canvas-lms,samuels410/greatlakes-lms,jay3126/canvas-lms,sli7246/canvas_branch,leftplusrightllc/canvas-lms,skmezanul/canvas-lms,SwinburneOnline/canvas-lms,arrivu/hoodemo,instructure/canvas-lms,whalejasmine/canvas-lms,shidao-fm/canvas-lms,greyhwndz/canvas-lms,utkarshx/canvas-lms,sfu/canvas-lms,ShreniiNepal/shrenii_lmp,whalejasmine/canvas-lms,wimemx/Canvas,HotChalk/canvas-lms,landonwilkins/canvas-lms,juoni/canvas-lms,nditech/red-innovadores-lms,em2/canvas-lms,jay3126/canvas-lms,SwinburneOnline/canvas-lms,Rvor/canvas-lms,wimemx/Canvas,skmezanul/canvas-lms,grahamb/canvas-lms,instructure/canvas-lms,kyroskoh/canvas-lms,snehakachroo1/LSI_replica,shidao-fm/canvas-lms,va7map/canvas-lms,icelab/canvas,snehakachroo1/LSI_replica,Jyaasa/canvas-lms,roxolan/canvas-lms,efrj/canvas-lms,AndranikMarkosyan/lms,landonwilkins/canvas-lms,matematikk-mooc/canvas-lms,narigone/canvas,venturehive/canvas-lms,nditech/red-innovadores-lms,wrdsb/canvas-lms,ankithbti/canvas_lms,skmezanul/canvas-lms,antoniuslin/canvas-lms,rup/Tarrax,fronteerio/canvas-lms,AndranikMarkosyan/lms,landonwilkins/canvas-lms,tgroshon/canvas-lms,sdeleon28/canvas-lms,faraazkhan/canvas,wye0220/shindig-canvas,whalejasmine/canvas-lms,wye0220/shindig-canvas,narigone/canvas,whalejasmine/canvas-lms,samuels410/greatlakes-lms,djbender/canvas-lms,matematikk-mooc/canvas-lms,redconfetti/canvas-lms,loganrun/pincan,roxolan/canvas-lms,leftplusrightllc/canvas-lms,arrivu/qibla-ecampus,arrivu/qibla-ecampus,ankithbti/canvas_lms,fronteerio/canvas-lms,instructure/canvas-lms,fronteerio/canvas-lms,Unow/ins,kyroskoh/canvas-lms,venturehive/canvas-lms,va7map/canvas-lms,Unow/canvas-lms,merichar/canvas-lms,instructure/canvas-lms,snehakachroo1/LSI_replica,HotChalk/canvas-lms,SwinburneOnline/canvas-lms,nditech/red-innovadores-lms,wye0220/shindig-canvas,arrivu/jigsaw-lms,antoniuslin/canvas-lms,ShreniiNepal/shrenii_lmp,ankithbti/canvas_lms,arrivu/jigsaw-lms,samuels410/greatlakes-lms,matematikk-mooc/canvas-lms,ShreniiNepal/shrenii_lmp,eCNAP/CANVAS,shidao-fm/canvas-lms,usmschuck/canvas,Unow/canvas-lms,rup/Tarrax,sli7246/canvas_branch,sfu/canvas-lms,sli7246/canvas_branch,roxolan/canvas-lms,wrdsb/canvas-lms,Rvor/canvas-lms,arrivu/arrivu-lms,antoniuslin/canvas-lms,faraazkhan/canvas,em2/canvas-lms,arrivu/hiring-site,venturehive/canvas-lms,loganrun/pincan,redconfetti/canvas-lms,djbender/canvas-lms,greyhwndz/canvas-lms,wrdsb/canvas-lms,leftplusrightllc/canvas-lms,narigone/canvas,sfu/canvas-lms,ShreniiNepal/shrenii_lmp,leftplusrightllc/canvas-lms,faraazkhan/canvas,HotChalk/canvas-lms,roxolan/canvas-lms,kyroskoh/canvas-lms,arrivu/hiring-site,jay3126/canvas-lms,Rvor/canvas-lms,eCNAP/CANVAS,grahamb/canvas-lms,venturehive/canvas-lms,skmezanul/canvas-lms,instructure/canvas-lms,AndranikMarkosyan/lms,dgynn/canvas-lms,dgynn/canvas-lms,utkarshx/canvas-lms,sdeleon28/canvas-lms,va7map/canvas-lms,em2/canvas-lms,djbender/canvas-lms,juoni/canvas-lms,arrivu/arrivu-lms,instructure/canvas-lms,Unow/canvas-lms,loganrun/pincan,HotChalk/canvas-lms,Unow/ins,grahamb/canvas-lms,greyhwndz/canvas-lms,Unow/ins,usmschuck/canvas,parbros/red-innovadores-lms,Jyaasa/canvas-lms,icelab/canvas,juoni/canvas-lms,merichar/canvas-lms,redconfetti/canvas-lms,sfu/canvas-lms,greyhwndz/canvas-lms,arrivu/hoodemo,ottenhoff/canvas-lms,ottenhoff/canvas-lms,juoni/canvas-lms,gbleydon/canvas-lms,merichar/canvas-lms,grahamb/canvas-lms,sfu/canvas-lms,tgroshon/canvas-lms,sfu/canvas-lms,usmschuck/canvas,Rvor/canvas-lms,wimemx/Canvas,parbros/red-innovadores-lms,AndranikMarkosyan/lms,gbleydon/canvas-lms,va7map/canvas-lms