Skip to content

v0.33.0 — model casts + mass-assignment guarding

Choose a tag to compare

@tshafer tshafer released this 11 Jul 00:49

Attribute casts: static casts = { active: "boolean", meta: "json", joined_at: "date" } round-trips columns as real JS types — cast on read, back to storable primitives on write, so boolean/json bind cleanly on drivers that reject JS booleans/objects. Types: int, float, boolean, string, json/array, date.

Mass-assignment guarding: static fillable (allowlist) / static guarded (denylist) filter what create() and fill() accept; forceFill() bypasses. With neither declared, behavior is unchanged (backward compatible).

See docs/models.md#attribute-casts.