Define group_by_products_id as a method so its existence isn't dependent on the table existing
Define group_by_products_id as a method so its existence isn't dependent on the table existing

Fixes #1247

KMikhaylovCTG/spree,project-eutopia/spree,maybii/spree,pervino/spree,woboinc/spree,watg/spree,builtbybuffalo/spree,athal7/solidus,biagidp/spree,ahmetabdi/spree,codesavvy/sandbox,lyzxsc/spree,useiichi/spree,odk211/spree,alvinjean/spree,Engeltj/spree,jparr/spree,dotandbo/spree,athal7/solidus,builtbybuffalo/spree,hifly/spree,mindvolt/spree,welitonfreitas/spree,miyazawatomoka/spree,yiqing95/spree,TrialGuides/spree,fahidnasir/spree,jparr/spree,sliaquat/spree,grzlus/spree,mleglise/spree,jhawthorn/spree,siddharth28/spree,PhoenixTeam/spree_phoenix,radarseesradar/spree,dafontaine/spree,thogg4/spree,CiscoCloud/spree,vmatekole/spree,Engeltj/spree,dotandbo/spree,degica/spree,TrialGuides/spree,alepore/spree,njerrywerry/spree,zaeznet/spree,vinayvinsol/spree,ramkumar-kr/spree,Hawaiideveloper/shoppingcart,sideci-sample/sideci-sample-spree,Ropeney/spree,trigrass2/spree,sfcgeorge/spree,vinayvinsol/spree,mindvolt/spree,agient/agientstorefront,firman/spree,forkata/solidus,progsri/spree,biagidp/spree,devilcoders/solidus,degica/spree,bjornlinder/Spree,Nevensoft/spree,odk211/spree,volpejoaquin/spree,richardnuno/solidus,progsri/spree,berkes/spree,Arpsara/solidus,jimblesm/spree,joanblake/spree,vmatekole/spree,jsurdilla/solidus,tomash/spree,imella/spree,surfdome/spree,pjmj777/spree,Mayvenn/spree,degica/spree,tomash/spree,CJMrozek/spree,madetech/spree,ayb/spree,codesavvy/sandbox,carlesjove/spree,vinsol/spree,Senjai/solidus,reidblomquist/spree,tailic/spree,freerunningtech/spree,abhishekjain16/spree,hoanghiep90/spree,shekibobo/spree,bonobos/solidus,devilcoders/solidus,assembledbrands/spree,useiichi/spree,jparr/spree,xuewenfei/solidus,vulk/spree,NerdsvilleCEO/spree,njerrywerry/spree,codesavvy/sandbox,derekluo/spree,Ropeney/spree,yiqing95/spree,jeffboulet/spree,jordan-brough/solidus,CJMrozek/spree,HealthWave/spree,alvinjean/spree,beni55/spree,locomotivapro/spree,caiqinghua/spree,moneyspyder/spree,useiichi/spree,carlesjove/spree,agient/agientstorefront,CJMrozek/spree,hifly/spree,JuandGirald/spree,cutefrank/spree,ramkumar-kr/spree,hoanghiep90/spree,Arpsara/solidus,Boomkat/spree,Lostmyname/spree,reidblomquist/spree,joanblake/spree,Boomkat/spree,hifly/spree,scottcrawford03/solidus,grzlus/spree,Senjai/solidus,raow/spree,softr8/spree,Hates/spree,caiqinghua/spree,archSeer/spree,richardnuno/solidus,karlitxo/spree,ayb/spree,Migweld/spree,welitonfreitas/spree,gautamsawhney/spree,Machpowersystems/spree_mach,madetech/spree,agient/agientstorefront,SadTreeFriends/spree,Ropeney/spree,jspizziri/spree,archSeer/spree,pervino/solidus,athal7/solidus,urimikhli/spree,adaddeo/spree,jhawthorn/spree,jeffboulet/spree,yomishra/pce,maybii/spree,wolfieorama/spree,alejandromangione/spree,kewaunited/spree,jaspreet21anand/spree,Nevensoft/spree,priyank-gupta/spree,jsurdilla/solidus,SadTreeFriends/spree,pervino/solidus,grzlus/solidus,delphsoft/spree-store-ballchair,Kagetsuki/spree,JDutil/spree,JuandGirald/spree,firman/spree,welitonfreitas/spree,cutefrank/spree,alejandromangione/spree,project-eutopia/spree,berkes/spree,softr8/spree,DynamoMTL/spree,omarsar/spree,Senjai/solidus,volpejoaquin/spree,jordan-brough/solidus,pulkit21/spree,abhishekjain16/spree,sideci-sample/sideci-sample-spree,reinaris/spree,ckk-scratch/solidus,lsirivong/solidus,sideci-sample/sideci-sample-spree,hifly/spree,pervino/spree,JDutil/spree,patdec/spree,tomash/spree,bricesanchez/spree,shaywood2/spree,sfcgeorge/spree,biagidp/spree,cutefrank/spree,alejandromangione/spree,DynamoMTL/spree,robodisco/spree,Mayvenn/spree,KMikhaylovCTG/spree,Engeltj/spree,caiqinghua/spree,archSeer/spree,Nevensoft/spree,locomotivapro/spree,tancnle/spree,rajeevriitm/spree,shekibobo/spree,alejandromangione/spree,firman/spree,caiqinghua/spree,welitonfreitas/spree,jspizziri/spree,groundctrl/spree,CJMrozek/spree,shaywood2/spree,grzlus/spree,berkes/spree,Kagetsuki/spree,dotandbo/spree,siddharth28/spree,quentinuys/spree,vulk/spree,bonobos/solidus,softr8/spree,raow/spree,assembledbrands/spree,alvinjean/spree,woboinc/spree,grzlus/solidus,keatonrow/spree,groundctrl/spree,SadTreeFriends/spree,yiqing95/spree,PhoenixTeam/spree_phoenix,nooysters/spree,piousbox/spree,rakibulislam/spree,siddharth28/spree,sunny2601/spree,volpejoaquin/spree,karlitxo/spree,richardnuno/solidus,knuepwebdev/FloatTubeRodHolders,Senjai/spree,ckk-scratch/solidus,yushine/spree,lsirivong/spree,odk211/spree,groundctrl/spree,trigrass2/spree,jeffboulet/spree,zaeznet/spree,TimurTarasenko/spree,KMikhaylovCTG/spree,adaddeo/spree,jsurdilla/solidus,orenf/spree,dandanwei/spree,dafontaine/spree,brchristian/spree,SadTreeFriends/spree,lsirivong/spree,jaspreet21anand/spree,pjmj777/spree,pulkit21/spree,jordan-brough/spree,piousbox/spree,dandanwei/spree,kewaunited/spree,FadliKun/spree,kitwalker12/spree,Senjai/spree,TrialGuides/spree,miyazawatomoka/spree,thogg4/spree,Antdesk/karpal-spree,net2b/spree,trigrass2/spree,nooysters/spree,kitwalker12/spree,Kagetsuki/spree,Hates/spree,patdec/spree,LBRapid/spree,xuewenfei/solidus,raow/spree,reinaris/spree,calvinl/spree,FadliKun/spree,ahmetabdi/spree,rbngzlv/spree,yushine/spree,StemboltHQ/spree,Migweld/spree,shioyama/spree,watg/spree,JuandGirald/spree,LBRapid/spree,jaspreet21anand/spree,delphsoft/spree-store-ballchair,azranel/spree,camelmasa/spree,sliaquat/spree,NerdsvilleCEO/spree,vinsol/spree,jaspreet21anand/spree,FadliKun/spree,omarsar/spree,azclick/spree,zaeznet/spree,yomishra/pce,dotandbo/spree,AgilTec/spree,RatioClothing/spree,lsirivong/spree,Arpsara/solidus,madetech/spree,bjornlinder/Spree,AgilTec/spree,jimblesm/spree,Boomkat/spree,calvinl/spree,wolfieorama/spree,gautamsawhney/spree,jasonfb/spree,moneyspyder/spree,CiscoCloud/spree,RatioClothing/spree,grzlus/solidus,APohio/spree,pervino/spree,shioyama/spree,edgward/spree,patdec/spree,hoanghiep90/spree,scottcrawford03/solidus,surfdome/spree,madetech/spree,vulk/spree,jsurdilla/solidus,vinayvinsol/spree,Hawaiideveloper/shoppingcart,azclick/spree,xuewenfei/solidus,project-eutopia/spree,alepore/spree,jordan-brough/solidus,alepore/spree,ahmetabdi/spree,tesserakt/clean_spree,Antdesk/karpal-spree,ckk-scratch/solidus,tesserakt/clean_spree,DarkoP/spree,priyank-gupta/spree,locomotivapro/spree,volpejoaquin/spree,azranel/spree,reinaris/spree,pervino/spree,Lostmyname/spree,karlitxo/spree,azranel/spree,dafontaine/spree,tancnle/spree,Nevensoft/spree,yomishra/pce,forkata/solidus,Hates/spree,CiscoCloud/spree,pervino/solidus,delphsoft/spree-store-ballchair,camelmasa/spree,priyank-gupta/spree,ayb/spree,Engeltj/spree,xuewenfei/solidus,gregoryrikson/spree-sample,trigrass2/spree,progsri/spree,sunny2601/spree,carlesjove/spree,knuepwebdev/FloatTubeRodHolders,beni55/spree,pulkit21/spree,jimblesm/spree,miyazawatomoka/spree,APohio/spree,miyazawatomoka/spree,tesserakt/clean_spree,AgilTec/spree,jeffboulet/spree,Ropeney/spree,vinayvinsol/spree,sunny2601/spree,NerdsvilleCEO/spree,moneyspyder/spree,tailic/spree,zamiang/spree,lsirivong/solidus,project-eutopia/spree,orenf/spree,mindvolt/spree,jasonfb/spree,lyzxsc/spree,fahidnasir/spree,bricesanchez/spree,njerrywerry/spree,bjornlinder/Spree,tesserakt/clean_spree,reinaris/spree,richardnuno/solidus,patdec/spree,APohio/spree,azranel/spree,fahidnasir/spree,jhawthorn/spree,tomash/spree,vulk/spree,calvinl/spree,gregoryrikson/spree-sample,gregoryrikson/spree-sample,Mayvenn/spree,shekibobo/spree,reidblomquist/spree,watg/spree,woboinc/spree,jasonfb/spree,ramkumar-kr/spree,maybii/spree,JDutil/spree,robodisco/spree,jparr/spree,sliaquat/spree,jasonfb/spree,softr8/spree,athal7/solidus,brchristian/spree,shaywood2/spree,edgward/spree,azclick/spree,kewaunited/spree,robodisco/spree,Migweld/spree,ujai/spree,derekluo/spree,hoanghiep90/spree,yiqing95/spree,joanblake/spree,grzlus/solidus,vmatekole/spree,thogg4/spree,FadliKun/spree,freerunningtech/spree,njerrywerry/spree,Lostmyname/spree,omarsar/spree,net2b/spree,gautamsawhney/spree,knuepwebdev/FloatTubeRodHolders,calvinl/spree,LBRapid/spree,keatonrow/spree,rajeevriitm/spree,ayb/spree,ckk-scratch/solidus,radarseesradar/spree,lyzxsc/spree,piousbox/spree,berkes/spree,kitwalker12/spree,Senjai/solidus,urimikhli/spree,dandanwei/spree,useiichi/spree,KMikhaylovCTG/spree,cutefrank/spree,assembledbrands/spree,codesavvy/sandbox,brchristian/spree,pervino/solidus,NerdsvilleCEO/spree,forkata/solidus,orenf/spree,imella/spree,ahmetabdi/spree,bricesanchez/spree,zamiang/spree,RatioClothing/spree,Kagetsuki/spree,grzlus/spree,TimurTarasenko/spree,ujai/spree,sliaquat/spree,Boomkat/spree,fahidnasir/spree,nooysters/spree,camelmasa/spree,mleglise/spree,keatonrow/spree,lsirivong/solidus,Arpsara/solidus,jordan-brough/solidus,Hates/spree,HealthWave/spree,zaeznet/spree,vcavallo/spree,pulkit21/spree,TimurTarasenko/spree,vcavallo/spree,mleglise/spree,yushine/spree,maybii/spree,dafontaine/spree,edgward/spree,abhishekjain16/spree,HealthWave/spree,karlitxo/spree,shekibobo/spree,scottcrawford03/solidus,beni55/spree,rbngzlv/spree,devilcoders/solidus,jspizziri/spree,agient/agientstorefront,radarseesradar/spree,adaddeo/spree,scottcrawford03/solidus,raow/spree,jimblesm/spree,jordan-brough/spree,firman/spree,surfdome/spree,PhoenixTeam/spree_phoenix,Hawaiideveloper/shoppingcart,odk211/spree,zamiang/spree,locomotivapro/spree,TimurTarasenko/spree,mindvolt/spree,sfcgeorge/spree,wolfieorama/spree,JuandGirald/spree,Migweld/spree,DarkoP/spree,progsri/spree,yushine/spree,omarsar/spree,orenf/spree,rajeevriitm/spree,vcavallo/spree,urimikhli/spree,imella/spree,radarseesradar/spree,quentinuys/spree,azclick/spree,reidblomquist/spree,PhoenixTeam/spree_phoenix,quentinuys/spree,tancnle/spree,robodisco/spree,TrialGuides/spree,wolfieorama/spree,moneyspyder/spree,nooysters/spree,gautamsawhney/spree,Antdesk/karpal-spree,freerunningtech/spree,edgward/spree,Lostmyname/spree,joanblake/spree,pjmj777/spree,DynamoMTL/spree,keatonrow/spree,thogg4/spree,lyzxsc/spree,camelmasa/spree,jordan-brough/spree,shioyama/spree,sunny2601/spree,kewaunited/spree,quentinuys/spree,DarkoP/spree,sfcgeorge/spree,APohio/spree,mleglise/spree,rakibulislam/spree,priyank-gupta/spree,StemboltHQ/spree,shaywood2/spree,alvinjean/spree,adaddeo/spree,StemboltHQ/spree,JDutil/spree,siddharth28/spree,Hawaiideveloper/shoppingcart,builtbybuffalo/spree,AgilTec/spree,carlesjove/spree,derekluo/spree,Mayvenn/spree,vmatekole/spree,Senjai/spree,devilcoders/solidus,Machpowersystems/spree_mach,builtbybuffalo/spree,vinsol/spree,tancnle/spree,beni55/spree,vinsol/spree,DarkoP/spree,vcavallo/spree,DynamoMTL/spree,ujai/spree,tailic/spree,Machpowersystems/spree_mach,lsirivong/solidus,rakibulislam/spree,derekluo/spree,brchristian/spree,rbngzlv/spree,net2b/spree,jspizziri/spree,archSeer/spree,CiscoCloud/spree,rbngzlv/spree,zamiang/spree,gregoryrikson/spree-sample,lsirivong/spree,surfdome/spree,bonobos/solidus,dandanwei/spree,abhishekjain16/spree,ramkumar-kr/spree,rakibulislam/spree,forkata/solidus,groundctrl/spree,piousbox/spree,net2b/spree,bonobos/solidus,delphsoft/spree-store-ballchair,rajeevriitm/spree