Guest User

Untitled

a guest
Jan 23rd, 2018
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. class Photo
  2. include DataMapper::Resource
  3.  
  4. property :id, Serial
  5.  
  6. has n, :taggings
  7. has n, :tags, :through => :taggings
  8. end
  9.  
  10. class Tag
  11. include DataMapper::Resource
  12.  
  13. property :id, Serial
  14.  
  15. has n, :taggings
  16. has n, :photos, :through => :taggings
  17. end
  18.  
  19. class Tagging
  20. include DataMapper::Resource
  21.  
  22. belongs_to :tag, :key => true
  23. belongs_to :photo, :key => true
  24. end
Add Comment
Please, Sign In to add comment