Create Active Record Self-Referential Relationships In Ruby on Rails

InstructorWill Johnson

Share this video with your friends

Send Tweet

If you want to give the users the ability to follow or become friends with each other. Rails lets you create a join table in your database and have it reference the user database table.

You can use Active Record to associate the new table with User table by using the class_name method