Skip to main content
100%

Gist 201082

✓ Published0🌍 Public
XXXX
Last edited Oct 4, 2009
Created on Oct 4, 2009

This example demonstrates a bug in DataMapper's dirty-tracking behavior for associated resources. It shows that after creating a `Foo` with two `Baz` children and a `Bar` belonging to it, modifying the `Bar`'s name and saving it still leaves `bar.dirty?` returning true—even after a reload. The code uses DataMapper’s `dm-core` resource properties (`Serial`, `String`, `:nullable`), relationships (`has 1`, `has n`, `belongs_to`), and methods like `create`, `save`, and `reload` with an in-memory SQLite3 setup.

AI-generated description

Similar vizzes