Skip to main content
100%

Gist 230650

✓ Published0🌍 Public
XXXX
Last edited Nov 10, 2009
Created on Nov 10, 2009

This example demonstrates how DataMapper tracks object changes before and after an attribute update. It shows the `dirty?` state of a newly created `Foo` resource, then applies `update(:is_admin => true)` and inspects the result. The code uses the `dm-core` Ruby library and defines a `Foo` class with a `Boolean` `is_admin` property marked as the primary key. It illustrates DataMapper’s dirty-tracking API by printing the initial and post-update status of the resource instance.

AI-generated description

Similar vizzes