You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+19Lines changed: 19 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,24 @@
1
1
# Changelog
2
2
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`.
0 commit comments