Ruby on Rails
has_one

Like belongs_to, has_one creates a one-to-one relationship from a single record in one table to a single record in another table. However, whereas a class that belongs_to another class has a foreign key in its table that references the table of the other class, a class that has_one of another class is referenced by the other class, and the foreign key will be found on the other class’s table.

The only time that you need to use a has_one relationship is in a purely one-to-one relationship where two classes reference exactly one record of each other class. In this case, Class A belongs_to Class B, and Class B has_one of Class A, and Class A’s table will contain the foreign key. The has_one relationship is never used in one-to-many relationships, because the children in a one-to-many relationship must contain a foreign key that references the parent. Therefore, a child always belongs_to a parent class.

Examples of this:

Screencast on has_one association