Skip to content

Commit 398098d

Browse files
committed
Bump version to 0.3.0
1 parent 7830727 commit 398098d

2 files changed

Lines changed: 20 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,24 @@
11
# Changelog
22

3+
## 0.3.0
4+
5+
### Added
6+
7+
- **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.
8+
- **Polymorphic associations.** Use `votable post(:hello)` to set both `votable_id` and `votable_type: "Post"`. Auto-detected in Rails from `_id`/`_type` column pairs without foreign key constraints. For manual schemas, declare with `polymorphic :votable`.
9+
- **Custom key strategies.** Any module or object responding to `generate(table_name, record_name)` can be passed as `key:` on a table definition.
10+
- **Custom primary key columns.** Tables using a column other than `id` as the primary key are auto-detected in Rails. For manual schemas, pass `primary_key: :uid`.
11+
- **Hardcoded IDs.** Set `id 42` in a record block to override the generated key. Foreign key references resolve to the hardcoded value.
12+
13+
### Internals
14+
15+
- Key generation strategies (`Key::Integer`, `Key::Uuid`) are stateless modules instead of a single `Key.generate` method.
16+
- All association types share a unified `resolve(ref, keys)` interface.
17+
- `KeyRegistry` pre-computes primary key values for all records.
18+
- `Default::Generator` wraps generator blocks instead of passing raw procs.
19+
- Foreign key naming conventions (`_id`, `_type`) live as class methods on `BelongsTo` and `PolymorphicBelongsTo`.
20+
- File-based `define` uses thread-local state instead of module-level `@pending_blocks`.
21+
322
## 0.2.0
423

524
### Breaking changes

lib/fixturebot/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# frozen_string_literal: true
22

33
module FixtureBot
4-
VERSION = "0.2.0"
4+
VERSION = "0.3.0"
55
end

0 commit comments

Comments
 (0)