Ensure enum scopes work properly with STI and inheritance
Ensure enum scopes work properly with STI and inheritance

The code was changed to call `where` on a specific class in 813c8c07,
but no reasoning was given and I can't see any good reason why we would
need to do that. This will ensure that the method is called on whatever
class the scope is called on.

Fixes #23013

lcreid/rails,Erol/rails,untidy-hair/rails,Vasfed/rails,alecspopa/rails,Spin42/rails,Edouard-chin/rails,felipecvo/rails,prathamesh-sonpatki/rails,amoody2108/TechForJustice,kmcphillips/rails,kmcphillips/rails,starknx/rails,betesh/rails,maicher/rails,riseshia/railsguides.kr,starknx/rails,mtsmfm/rails,yahonda/rails,yawboakye/rails,gcourtemanche/rails,schuetzm/rails,EmmaB/rails-1,lucasmazza/rails,BlakeWilliams/rails,Stellenticket/rails,coreyward/rails,Vasfed/rails,odedniv/rails,richseviora/rails,kirs/rails-1,flanger001/rails,koic/rails,vipulnsward/rails,jeremy/rails,Sen-Zhang/rails,mathieujobin/reduced-rails-for-travis,Vasfed/rails,bogdanvlviv/rails,esparta/rails,yasslab/railsguides.jp,baerjam/rails,vipulnsward/rails,printercu/rails,pvalena/rails,Edouard-chin/rails,illacceptanything/illacceptanything,kamipo/rails,matrinox/rails,illacceptanything/illacceptanything,MSP-Greg/rails,arjes/rails,Erol/rails,bogdanvlviv/rails,repinel/rails,Stellenticket/rails,assain/rails,rossta/rails,rails/rails,rbhitchcock/rails,notapatch/rails,kamipo/rails,illacceptanything/illacceptanything,illacceptanything/illacceptanything,travisofthenorth/rails,voray/rails,iainbeeston/rails,mtsmfm/railstest,Sen-Zhang/rails,illacceptanything/illacceptanything,baerjam/rails,xlymian/rails,mtsmfm/railstest,arjes/rails,brchristian/rails,kamipo/rails,tijwelch/rails,mechanicles/rails,deraru/rails,aditya-kapoor/rails,kenta-s/rails,illacceptanything/illacceptanything,kaspth/rails,tijwelch/rails,yawboakye/rails,fabianoleittes/rails,utilum/rails,kenta-s/rails,ledestin/rails,arunagw/rails,brchristian/rails,gauravtiwari/rails,palkan/rails,illacceptanything/illacceptanything,baerjam/rails,untidy-hair/rails,Erol/rails,Stellenticket/rails,repinel/rails,kmcphillips/rails,illacceptanything/illacceptanything,gavingmiller/rails,kachick/rails,MSP-Greg/rails,tjschuck/rails,schuetzm/rails,yhirano55/rails,koic/rails,aditya-kapoor/rails,vassilevsky/rails,eileencodes/rails,shioyama/rails,palkan/rails,kmayer/rails,arunagw/rails,arunagw/rails,mathieujobin/reduced-rails-for-travis,illacceptanything/illacceptanything,vipulnsward/rails,ledestin/rails,felipecvo/rails,bolek/rails,richseviora/rails,jeremy/rails,yhirano55/rails,riseshia/railsguides.kr,iainbeeston/rails,ttanimichi/rails,mechanicles/rails,eileencodes/rails,rafaelfranca/omg-rails,georgeclaghorn/rails,palkan/rails,arunagw/rails,Stellenticket/rails,mijoharas/rails,esparta/rails,gfvcastro/rails,aditya-kapoor/rails,yalab/rails,kenta-s/rails,alecspopa/rails,marklocklear/rails,joonyou/rails,prathamesh-sonpatki/rails,lucasmazza/rails,yhirano55/rails,gfvcastro/rails,rossta/rails,BlakeWilliams/rails,hanystudy/rails,repinel/rails,richseviora/rails,rbhitchcock/rails,yahonda/rails,Envek/rails,BlakeWilliams/rails,yasslab/railsguides.jp,tgxworld/rails,gauravtiwari/rails,riseshia/railsguides.kr,ngpestelos/rails,gcourtemanche/rails,shioyama/rails,alecspopa/rails,tjschuck/rails,felipecvo/rails,illacceptanything/illacceptanything,kaspth/rails,bolek/rails,rails/rails,ttanimichi/rails,mtsmfm/rails,joonyou/rails,georgeclaghorn/rails,kddeisz/rails,esparta/rails,vassilevsky/rails,tgxworld/rails,yalab/rails,riseshia/railsguides.kr,utilum/rails,esparta/rails,arjes/rails,mohitnatoo/rails,xlymian/rails,bradleypriest/rails,samphilipd/rails,hanystudy/rails,kachick/rails,gfvcastro/rails,flanger001/rails,deraru/rails,baerjam/rails,brchristian/rails,eileencodes/rails,MichaelSp/rails,travisofthenorth/rails,untidy-hair/rails,vassilevsky/rails,kddeisz/rails,kddeisz/rails,notapatch/rails,Spin42/rails,yawboakye/rails,yalab/rails,odedniv/rails,gavingmiller/rails,coreyward/rails,maicher/rails,georgeclaghorn/rails,illacceptanything/illacceptanything,ngpestelos/rails,mohitnatoo/rails,matrinox/rails,MichaelSp/rails,Vasfed/rails,pvalena/rails,notapatch/rails,mohitnatoo/rails,MSP-Greg/rails,shioyama/rails,yawboakye/rails,deraru/rails,kachick/rails,tijwelch/rails,assain/rails,aditya-kapoor/rails,prathamesh-sonpatki/rails,pschambacher/rails,ttanimichi/rails,palkan/rails,Envek/rails,sealocal/rails,samphilipd/rails,Edouard-chin/rails,BlakeWilliams/rails,rafaelfranca/omg-rails,kaspth/rails,pschambacher/rails,sergey-alekseev/rails,matrinox/rails,marklocklear/rails,stefanmb/rails,lcreid/rails,vipulnsward/rails,schuetzm/rails,sealocal/rails,elfassy/rails,joonyou/rails,bradleypriest/rails,ledestin/rails,Spin42/rails,schuetzm/rails,bogdanvlviv/rails,flanger001/rails,flanger001/rails,lcreid/rails,joonyou/rails,stefanmb/rails,printercu/rails,mtsmfm/rails,coreyward/rails,elfassy/rails,iainbeeston/rails,utilum/rails,georgeclaghorn/rails,mohitnatoo/rails,illacceptanything/illacceptanything,kirs/rails-1,xlymian/rails,gavingmiller/rails,travisofthenorth/rails,gauravtiwari/rails,rossta/rails,utilum/rails,fabianoleittes/rails,Envek/rails,gcourtemanche/rails,rails/rails,travisofthenorth/rails,yahonda/rails,assain/rails,pvalena/rails,lcreid/rails,starknx/rails,notapatch/rails,pvalena/rails,sergey-alekseev/rails,kmayer/rails,tgxworld/rails,rails/rails,mijoharas/rails,fabianoleittes/rails,marklocklear/rails,MichaelSp/rails,shioyama/rails,iainbeeston/rails,voray/rails,bogdanvlviv/rails,koic/rails,jeremy/rails,assain/rails,eileencodes/rails,hanystudy/rails,illacceptanything/illacceptanything,elfassy/rails,illacceptanything/illacceptanything,pschambacher/rails,yalab/rails,kirs/rails-1,fabianoleittes/rails,betesh/rails,printercu/rails,gfvcastro/rails,tgxworld/rails,jeremy/rails,EmmaB/rails-1,printercu/rails,mtsmfm/railstest,kmayer/rails,samphilipd/rails,amoody2108/TechForJustice,MSP-Greg/rails,amoody2108/TechForJustice,sealocal/rails,Sen-Zhang/rails,prathamesh-sonpatki/rails,ngpestelos/rails,illacceptanything/illacceptanything,mathieujobin/reduced-rails-for-travis,lucasmazza/rails,EmmaB/rails-1,mechanicles/rails,Erol/rails,sergey-alekseev/rails,bradleypriest/rails,repinel/rails,bolek/rails,yasslab/railsguides.jp,betesh/rails,rbhitchcock/rails,stefanmb/rails,mijoharas/rails,maicher/rails,untidy-hair/rails,yasslab/railsguides.jp,Edouard-chin/rails,yhirano55/rails,betesh/rails,yahonda/rails,rafaelfranca/omg-rails,odedniv/rails,deraru/rails,mechanicles/rails,voray/rails,Envek/rails,kddeisz/rails,tjschuck/rails,tjschuck/rails,kmcphillips/rails