diff options
author | Andre Arko <andre@arko.net> | 2008-05-31 23:19:40 -0700 |
---|---|---|
committer | Michael Koziarski <michael@koziarski.com> | 2008-07-06 20:25:10 +0200 |
commit | 3351d2997017465047b2c3dc63dc31e2362368af (patch) | |
tree | c8e315d0a9f4d9cb759c231077b192fa8ce7d9f9 /activerecord/test/models | |
parent | 1d8623b42f6249613d39e834a8742b3b143f2aff (diff) | |
download | rails-3351d2997017465047b2c3dc63dc31e2362368af.tar.gz rails-3351d2997017465047b2c3dc63dc31e2362368af.tar.bz2 rails-3351d2997017465047b2c3dc63dc31e2362368af.zip |
Add has_many :primary_key option to allow setting the primary key on a has many association
Signed-off-by: Michael Koziarski <michael@koziarski.com>
Diffstat (limited to 'activerecord/test/models')
-rwxr-xr-x | activerecord/test/models/company.rb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/activerecord/test/models/company.rb b/activerecord/test/models/company.rb index 9fa810ac68..c45a21b6a2 100755 --- a/activerecord/test/models/company.rb +++ b/activerecord/test/models/company.rb @@ -46,6 +46,8 @@ class Firm < Company has_many :clients_using_finder_sql, :class_name => "Client", :finder_sql => 'SELECT * FROM companies WHERE 1=1' has_many :plain_clients, :class_name => 'Client' has_many :readonly_clients, :class_name => 'Client', :readonly => true + has_many :clients_using_primary_key, :class_name => 'Client', + :primary_key => 'name', :foreign_key => 'firm_name' has_one :account, :foreign_key => "firm_id", :dependent => :destroy, :validate => true has_one :unvalidated_account, :foreign_key => "firm_id", :class_name => 'Account', :validate => false |