Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto-register namespaces #83

Merged
merged 3 commits into from
Jun 30, 2024
Merged

Auto-register namespaces #83

merged 3 commits into from
Jun 30, 2024

Conversation

kaspth
Copy link
Owner

@kaspth kaspth commented Jun 30, 2024

Oaken now auto-registers namespaced models as well.

So in addition to accounts => Account, we can also auto-register partial and fully nested namespaces, in this order:

account_jobs => AccountJob | Account::Job
account_job_tasks => AccountJobTask | Account::JobTask | Account::Job::Task

If you have classes that don't follow this naming convention, you must call register manually.

Oaken now auto-registers namespaced models as well.

So in addition to `accounts` => `Account`, we can also auto-register partial and fully nested namespaces, in this order:

```
account_jobs => AccountJob | Account::Job
account_job_tasks => AccountJobTask | Account::JobTask | Account::Job::Task
```

If you have classes that don't follow this naming convention, you must call `register` manually.
@kaspth kaspth merged commit 1da4cdf into main Jun 30, 2024
2 checks passed
@kaspth kaspth deleted the auto-register-namespaces branch June 30, 2024 17:45
@kaspth kaspth mentioned this pull request Jun 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant