Guest User

Untitled

a guest
May 26th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. class User < ActiveRecord::Base
  2.  
  3. has_many :registries
  4. has_many :viewers
  5. has_many :registries, :through => :viewers
  6.  
  7. end
  8.  
  9. class Registry < ActiveRecord::Base
  10.  
  11. belongs_to :user
  12. has_many :viewers
  13. has_many :users, :through => :viewers
  14.  
  15. end
  16.  
  17.  
  18. class Viewer < ActiveRecord::Base
  19.  
  20. belongs_to :user
  21. belongs_to :registry
  22.  
  23. end
Add Comment
Please, Sign In to add comment