# Confusing one-to-one Association example at docs?

**URL:** <https://discuss.rubyonrails.org/t/confusing-one-to-one-association-example-at-docs/36403>\
**Category:** rubyonrails-core\
**Created:** [November 16, 2008, 10:57am UTC](https://discuss.rubyonrails.org/t/confusing-one-to-one-association-example-at-docs/36403 "2008-11-16T10:57:12Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Carlos\_Paramio](https://avatars.discourse-cdn.com/v4/letter/c/e19adc/32.png) [@Carlos\_Paramio](https://discuss.rubyonrails.org/u/Carlos_Paramio)\
**Post date:** [November 16, 2008, 10:57am UTC](https://discuss.rubyonrails.org/t/confusing-one-to-one-association-example-at-docs/36403/1 "2008-11-16T10:57:12Z")

</div>

I think that the one-to-one example, at the ActiveRecord::Associations::ClassMethods module, in the documentation about "Cardinality and associations", is confusing. The example refers to an office that belongs to one employer, and an employer that has one office, leaving the foreign key on the Office model pointing to the employee\_id. Maybe the reversed example is much more natural and nearer to the reality: An employee belongs to an office (where he works), and the office has one employee, creating the office\_id foreign key at the Employee model. This example also leaves the posibility for the database structure to grow to a multiple-employee office design easily, just by changing the has\_one macro by has\_many, without touching the database.

Ticket + patch at:

[http://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/1328](http://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/1328)

What do you think?
