Repository navigation
Document combining model_classes with prefer_conventional_models - #137
Merged
Merged
Conversation
The conventional-name preference cannot pick a namespaced or otherwise unconventionally named model, so an application with such a table needs an explicit model_classes entry for it. Show that the two settings combine, with model_classes winning for the tables it names.
There was a problem hiding this comment.
🟢 Approval recommended
This documentation-only change has one minor wording clarification and no blocking issues.
1 open finding
What changed in this PR
Documents how explicit model mappings work alongside conventional model preference in FixtureBuilder.
Changes:
- Explains mapping precedence and the limitation for namespaced models.
- Adds a configuration example combining both settings.
| File | Description |
|---|---|
| README.md | Adds combined model-selection guidance and an example. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| The preference cannot help when the real model is namespaced or otherwise not | ||
| named `table_name.classify`, such as `Catalog::Widget` for `widgets`. The two | ||
| settings combine: `model_classes` entries win for the tables they name, and the | ||
| preference handles every other ambiguous table. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

prefer_conventional_modelsonly helps when one of the ambiguous models is namedtable_name.classify. When the real model is namespaced (for exampleCatalog::Widgetforwidgets), the preference has nothing to pick, and the table needs amodel_classesentry.This adds a README paragraph and example showing the two settings together:
model_classesentries win for the tables they name, and the preference handles every other ambiguous table. Docs only, so no CHANGELOG entry.