Generate model-aware fixtures - #116
Open
nertzy wants to merge 1 commit into
Open
Conversation
nertzy
force-pushed
the
model-aware-fixture-generation
branch
from
September 8, 2026 00:44
3cb10a2 to
e0e3f4e
Compare
nertzy
marked this pull request as ready for review
September 8, 2026 16:23
nertzy
force-pushed
the
model-aware-fixture-generation
branch
5 times, most recently
from
September 11, 2026 23:25
d8a392c to
c816d0e
Compare
nertzy
force-pushed
the
model-aware-fixture-generation
branch
from
September 12, 2026 00:17
c816d0e to
52af7ba
Compare
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.
Fixture generation currently treats every configured table as raw SQL. That leaves Rails without enough model information to reload generated fixtures for models whose constants do not follow the conventional table-name inference.
This foundation resolves eligible Active Record models by their configured table names and writes Rails-native
_fixture.model_classmetadata for model-backed output. It preserves raw-SQL behavior when no eligible model is available, including tables without usable primary keys and models on another connection pool.It also organizes tests into one concrete case per file, with path-matching namespaces under
test/builder/,test/configuration/, andtest/model_resolver/. The top-leveltest/fixture_builder_test.rbretains integration coverage through the public API, and recursive discovery includes the nested suites. Isolated model-backed tests own their ephemeral schemas withwith_model.This replaces the earlier draft stack in #112, #113, and #115. The dependent follow-up migrates the remaining ordinary fixture tests to the same ownership model.