Guest User

Untitled

a guest
May 25th, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. class Album < ActiveRecord::Base
  2. has_many :songs
  3. belongs_to :artist
  4. has_many :transactions
  5. end
  6.  
  7. class Artist < ActiveRecord::Base
  8. has_many :albums
  9. has_many :transactions
  10. end
  11.  
  12. class Song < ActiveRecord::Base
  13. belongs_to :album
  14. has_many :transactions
  15. end
  16.  
  17. class User < ActiveRecord::Base
  18. has_many :transactions
  19. end
  20.  
  21. class Transaction < ActiveRecord::Base
  22. belongs_to :user
  23.  
  24. belongs_to :album
  25. belongs_to :song
  26. belongs_to :artist
  27. end
Add Comment
Please, Sign In to add comment