Skip to content

Enable Zeitwerk #268

@vangberg

Description

@vangberg

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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions