Skip to content

Instantly share code, notes, and snippets.

@frnz
Created December 9, 2010 03:19
Show Gist options
  • Save frnz/734286 to your computer and use it in GitHub Desktop.
Save frnz/734286 to your computer and use it in GitHub Desktop.
Diego's version:
class User
include DataMapper::Resource
has n, :projects
end
class Project
include DataMapper::Resource
belongs_to :user, :key => true
has n, :steps
end
class Step
include DataMapper::Resource
belongs_to :project, :key => true
has n, :images
end
class Image
include DataMapper::Resource
belongs_to :step, :key => true
has n, :notes
end
class Note
include DataMapper::Resource
belongs_to :image, :key => true
has n, :comments
end
class Comment
include DataMapper::Resource
belongs_to :note, :key => true
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment