Commit ca877ed
Rename mount label to "FixtureKit Insert" and harden coder subscriber (#53)
The execute_batch label for fixture mount changes from "FixtureKit Load"
to "FixtureKit Insert" to align with Rails' own fixture insert naming.
The label rename causes fixture_kit's own mount notifications to match
the coder's NAME_PATTERN (which recognizes "Insert" as a write verb).
Without a guard, nested fixture inheritance would feed the parent's
mount notification back into the child's generate subscriber and
constantize "FixtureKit" — the module, not a class — and crash inside
base_table_model.
Switch the subscriber to safe_constantize and require the result to be
a Class < ActiveRecord::Base before capturing it. Non-AR matches are
silently skipped instead of raising.
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 9aae82d commit ca877ed
3 files changed
Lines changed: 9 additions & 6 deletions
File tree
- lib/fixture_kit/coders
- spec/unit
- coders
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
19 | 22 | | |
20 | 23 | | |
21 | 24 | | |
| |||
31 | 34 | | |
32 | 35 | | |
33 | 36 | | |
34 | | - | |
| 37 | + | |
35 | 38 | | |
36 | 39 | | |
37 | 40 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
140 | 140 | | |
141 | 141 | | |
142 | 142 | | |
143 | | - | |
| 143 | + | |
144 | 144 | | |
145 | | - | |
| 145 | + | |
146 | 146 | | |
147 | 147 | | |
148 | 148 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
356 | 356 | | |
357 | 357 | | |
358 | 358 | | |
359 | | - | |
| 359 | + | |
360 | 360 | | |
361 | | - | |
| 361 | + | |
362 | 362 | | |
363 | 363 | | |
364 | 364 | | |
| |||
0 commit comments