From afa0c7f728a8896c9ee9d932033e08a4c99dfd50 Mon Sep 17 00:00:00 2001 From: Brad Greenlee Date: Mon, 2 Jun 2008 22:04:46 -0700 Subject: Add support for :primary_key option to has_one as well as has_many so that a key other than the default primary key can be used for the association Signed-off-by: Michael Koziarski --- activerecord/test/models/company.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'activerecord/test/models') diff --git a/activerecord/test/models/company.rb b/activerecord/test/models/company.rb index c45a21b6a2..e6aa810146 100755 --- a/activerecord/test/models/company.rb +++ b/activerecord/test/models/company.rb @@ -53,6 +53,7 @@ class Firm < Company has_one :unvalidated_account, :foreign_key => "firm_id", :class_name => 'Account', :validate => false has_one :account_with_select, :foreign_key => "firm_id", :select => "id, firm_id", :class_name=>'Account' has_one :readonly_account, :foreign_key => "firm_id", :class_name => "Account", :readonly => true + has_one :account_using_primary_key, :primary_key => "firm_id", :class_name => "Account" end class DependentFirm < Company -- cgit v1.2.3