- FactoryBot-compatible syntax methods.
build,create,build_stubbed,attributes_for, and list/pair variants are now available in your tests. Pass a table name and fixture name:build(:user, :brad),create(:user, :brad, name: "X"). These delegate to Rails fixture accessors under the hood. - SimpleCov added for test coverage reporting.
- UUID primary keys. Tables with UUID primary keys are auto-detected in Rails. For manual schemas, pass
key: FixtureBot::Key::Uuid. Generates deterministic UUID v5 values. - Polymorphic associations. Use
votable post(:hello)to set bothvotable_idandvotable_type: "Post". Auto-detected in Rails from_id/_typecolumn pairs without foreign key constraints. For manual schemas, declare withpolymorphic :votable. - Custom key strategies. Any module or object responding to
generate(table_name, record_name)can be passed askey:on a table definition. - Custom primary key columns. Tables using a column other than
idas the primary key are auto-detected in Rails. For manual schemas, passprimary_key: :uid. - Hardcoded IDs. Set
id 42in a record block to override the generated key. Foreign key references resolve to the hardcoded value.
- Key generation strategies (
Key::Integer,Key::Uuid) are stateless modules instead of a singleKey.generatemethod. - All association types share a unified
resolve(ref, keys)interface. KeyRegistrypre-computes primary key values for all records.Default::Generatorwraps generator blocks instead of passing raw procs.- Foreign key naming conventions (
_id,_type) live as class methods onBelongsToandPolymorphicBelongsTo. - File-based
defineuses thread-local state instead of module-level@pending_blocks.
-
Generator block parameter: Generator blocks now receive a
fixtureobject as a block parameter instead of the magicnamemethod. Usefixture.keyto get the record's symbol name. Column values are available as bare methods inside the block.# Before user.email { "#{name}@example.com" } # After user.email { |fixture| "#{fixture.key}@example.com" }
- Rename
YamlDumpertoCompiler,generate/dumptocompile - Rename rake task from
fixturebot:generatetofixturebot:compile - Strip YAML document prefix (
---) from compiled output - Fix CLI entrypoint to detect Rails app instead of rescuing LoadError
- Internal refactor: group classes into
RowandDefaultmodules, replacemethod_missingwithdefine_singleton_method
- Internal refactoring and README updates
- Initial release
- Ruby DSL for defining fixtures with generators, associations, and join tables
- Auto-generates YAML fixture files from database schema
- RSpec and Minitest integration with auto-generation hooks
- Rails Railtie with
config.fixturebotnamespace andfixturebot:generaterake task - Install generator:
rails generate fixturebot:install