ActiveRecord's relationship is sensitive to the plurality of the database table name.
Let's say, blogs contains many posts, then blogs should be on singular side and posts on plural side.
For has_one and belongs_to relationship, it should be singular. Suppose each user has only one avatar:
If you don't follow the convention, it won't work.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment