Advertisement
Guest User

Untitled

a guest
Oct 25th, 2014
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. class Doctor < ActiveRecord::Base
  2. has_many :reviews
  3. has_many :users, through: :reviews
  4. end
  5.  
  6. class Review <ActiveRecord::Base
  7. belongs_to :user
  8. belongs_to :doctor
  9. end
  10.  
  11. class User < ActiveRecord::Base
  12. has_many :reviews
  13. has_many :doctors, through: :reviews
  14. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement