Guest User

Untitled

a guest
Aug 20th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. Rails 3.1 - 3 Way Associations
  2. #student.rb
  3. has_and_belongs_to_many :lessons, :join_table => :attendance
  4. has_many :invoices, :dependent => :destroy
  5.  
  6. #lesson.rb
  7. belongs_to :course
  8. has_and_belongs_to_many :students, :join_table => :attendance
  9.  
  10. #invoice.rb
  11. belongs_to :student
Add Comment
Please, Sign In to add comment