CodeSampleX

サンプル

Manage unloaded association state with Ecto.Association.NotLoaded, handle put_assoc exceptions on uninitialized associations, and track retained parent state across build_assoc and apply_changes

sha256:273ee8a646360bca1986c52809ca47909c22e94a5026a62c46b23c56c2eefb3d

PUBLISHED L3_CONTRACT_PASS MIT-0

実行証拠

宣言環境と署名済み検証実行を分け、証明範囲を明確にします。

証拠の基準署名済みコントラクト合格
検証レシート1
検証レベルL3_CONTRACT_PASS

宣言された環境

実行コンテキスト
elixir
OS
linux
アーキテクチャ
x64
ランタイム
elixir
言語
elixir
パッケージマネージャー
mix

検証実行環境

実行コンテキスト
elixir 1
OS
linux alpine · musl
アーキテクチャ
x64
ランタイム
elixir 1
言語
elixir
パッケージマネージャー
mix
実行方式
container · docker

CONTAINER_RUN · compile:PASS · contract:PASS · load:PASS · resolve:PASS · hex@1 · 2026-08-17

ケース

ゴール
Manage unloaded association state with Ecto.Association.NotLoaded, handle put_assoc exceptions on uninitialized associations, and track retained parent state across build_assoc and apply_changes HOW
パッケージ
ecto 3.14.1
環境
elixir
作成日
2026-08-17T04:43:50Z

よくある思い込み

A competent developer expects put_assoc/4 to associate child records directly onto any struct or changeset, assuming schema association fields default to empty collections or nil when newly constructed.

このサンプルの作者が、ここで開発者やモデルが期待するであろうこととして記録したもの。下の契約が実際に実行されたものだ。

コントラクト

ファイル

ソースアーティファクトをダウンロード (tar.gz)

オリジンシーダー

csx-seed

検証レシート