- Online Exam Test Papers | - MCQs[multiple choice questions and answers ] | - Mock Test Papers | - Practice Papers | - Sample Test Papers |

Question:
 In ActiveRecord, what is the difference between the has_many and has_many :through associations?

1.The has_many: through association is the one-to-many equivalent to the belongs_to one-to-one association.

2.Both associations are identical, and has_many: through is maintained only for legacy purposes.

3.The has_many association is a one-to-many association, while has_many: through is a one-to-one association that matches through a third model.

4.Both are one-to-many associations but with has_many :through, the declaring model can associate through a third model.

Posted Date:-2022-09-17 03:51:52


More MCQS Questions and answers

Search