Rails 7 does not ship with classic autoloading anymore, so we need to switch to Zeitwerk. Migration guide: Classic to Zeitwork HOWTO.
Right now the main blocker are the service objects in app/services. Zeitwork expects e.g. app/services/name/fuzzy_search.rb to define Name::FuzzySearch and not Services::Name::FuzzySearch. This matches the Rails default, e.g. app/controllers/page_controller.rb defines PageController and not Controllers::PageController.
My suggestion would be to skip the name folder and move both services to top-level app/services, so we have e.g. app/services/fuzzy_search.rb which defines the class FuzzySearchService. I think this makes sense given that service objects are rarely tied to a specific model, but rather act as orchestration of multiple models. This is apparent in TypeResolver which is also in app/services/name but works on multiple models (Name, Genome, Strain).
Rails 7 does not ship with classic autoloading anymore, so we need to switch to Zeitwerk. Migration guide: Classic to Zeitwork HOWTO.
Right now the main blocker are the service objects in
app/services. Zeitwork expects e.g.app/services/name/fuzzy_search.rbto defineName::FuzzySearchand notServices::Name::FuzzySearch. This matches the Rails default, e.g.app/controllers/page_controller.rbdefinesPageControllerand notControllers::PageController.My suggestion would be to skip the
namefolder and move both services to top-levelapp/services, so we have e.g.app/services/fuzzy_search.rbwhich defines the classFuzzySearchService. I think this makes sense given that service objects are rarely tied to a specific model, but rather act as orchestration of multiple models. This is apparent inTypeResolverwhich is also inapp/services/namebut works on multiple models (Name,Genome,Strain).