Prepare Interview

Mock Exams

Make Homepage

Bookmark this page

Subscribe Email Address

Ruby%20On%20Rails%20Interview%20Questions%20and%20Answers

Question: Explain the difference between a has_one and belongs_to association in Ruby on Rails.
Answer:
has_one: Indicates a direct 1:1 relationship between objects where each instance of a model contains one instance of another model.
A product has_one provider, a customer has_one order.


Is it helpful? Yes No

Most helpful rated by users:

©2024 WithoutBook