From c60a1cc487d349ff942bb219797eca070a71ce09 Mon Sep 17 00:00:00 2001 From: Carlos Paramio Date: Tue, 4 Nov 2008 20:22:14 +0100 Subject: [PATCH] One-to-one ActiveRecord example now is 'employee belongs to office, office has one employee' --- activerecord/lib/active_record/associations.rb | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/activerecord/lib/active_record/associations.rb b/activerecord/lib/active_record/associations.rb index c7cb6eb..ef969b4 100755 --- a/activerecord/lib/active_record/associations.rb +++ b/activerecord/lib/active_record/associations.rb @@ -166,11 +166,11 @@ module ActiveRecord # # Use +has_one+ in the base, and +belongs_to+ in the associated model. # - # class Employee < ActiveRecord::Base - # has_one :office - # end # class Office < ActiveRecord::Base - # belongs_to :employee # foreign key - employee_id + # has_one :employee + # end + # class Employee < ActiveRecord::Base + # belongs_to :office # foreign key - office_id # end # # === One-to-many -- 1.6.0.2