Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Photo
- include DataMapper::Resource
- property :id, Serial
- has n, :taggings
- has n, :tags, :through => :taggings
- end
- class Tag
- include DataMapper::Resource
- property :id, Serial
- has n, :taggings
- has n, :photos, :through => :taggings
- end
- class Tagging
- include DataMapper::Resource
- belongs_to :tag, :key => true
- belongs_to :photo, :key => true
- end
Add Comment
Please, Sign In to add comment