Skip to content

Generate model-aware fixtures - #116

Open
nertzy wants to merge 1 commit into
masterfrom
model-aware-fixture-generation
Open

Generate model-aware fixtures#116
nertzy wants to merge 1 commit into
masterfrom
model-aware-fixture-generation

Conversation

@nertzy

@nertzy nertzy commented Sep 8, 2026

Copy link
Copy Markdown
Collaborator

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_class metadata 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/, and test/model_resolver/. The top-level test/fixture_builder_test.rb retains integration coverage through the public API, and recursive discovery includes the nested suites. Isolated model-backed tests own their ephemeral schemas with with_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.

@nertzy
nertzy force-pushed the model-aware-fixture-generation branch from 3cb10a2 to e0e3f4e Compare September 8, 2026 00:44
@nertzy
nertzy marked this pull request as ready for review September 8, 2026 16:23
@nertzy
nertzy force-pushed the model-aware-fixture-generation branch 5 times, most recently from d8a392c to c816d0e Compare September 11, 2026 23:25
@nertzy
nertzy force-pushed the model-aware-fixture-generation branch from c816d0e to 52af7ba Compare September 12, 2026 00:17
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