To establish an association from a Post model to another Post model (say if one post is in response to another and there is a parent_post_id column on the posts table) - you would add the following to the Post model:

🎲 Try a Random Question  |  Total Questions in Quiz: 122  |  🧠 Study this quiz with Flashcards
This question is part of a full practice quiz:
Ruby on Rails Fundamentals Test — practice the complete quiz, review flashcards, or try a random question.


To establish an association from a Post model to another Post model (say if one post is in response to another and there is a parent_post_id column on the posts table) - you would add the following to the Post model: