Gist 203774
✓ Published0🌍 Public
XXXX
Last edited Oct 7, 2009
Created on Oct 7, 2009
This example demonstrates a data model involving three linked DataMapper resources—Foo, Bar, and Baz—with bidirectional associations and a nullable belongs-to relationship for tracking a current bar. It shows how to define database schema properties, Sweatshop fixtures for generating sample records, and an in-memory SQLite setup followed by auto-migration. The code creates a Foo with its bars and bazs, then updates the Foo’s current_bar reference to its first bar, illustrating persistence and association handling through DataMapper’s API and the `dm-sweatshop` fixture generator.
AI-generated description