diff options
author | Roman Shterenzon <romanbsd@yahoo.com> | 2008-12-27 01:10:29 +0000 |
---|---|---|
committer | Frederick Cheung <frederick.cheung@gmail.com> | 2008-12-27 01:10:29 +0000 |
commit | 21efba464afa2ae6e5dfd938ac8a3ce446faf7e7 (patch) | |
tree | 0d4958fdb36d32a94c3c7295bf4cb129ebcc7507 /activerecord/test/cases/associations | |
parent | f9cab0e503a4721c9d0369f89bb85c6e658f778c (diff) | |
download | rails-21efba464afa2ae6e5dfd938ac8a3ce446faf7e7.tar.gz rails-21efba464afa2ae6e5dfd938ac8a3ce446faf7e7.tar.bz2 rails-21efba464afa2ae6e5dfd938ac8a3ce446faf7e7.zip |
Fix HasManyAssociation#create ignoring the :primary_key option [#1633 state:resolved]
Signed-off-by: Frederick Cheung <frederick.cheung@gmail.com>
Diffstat (limited to 'activerecord/test/cases/associations')
-rw-r--r-- | activerecord/test/cases/associations/has_many_associations_test.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/activerecord/test/cases/associations/has_many_associations_test.rb b/activerecord/test/cases/associations/has_many_associations_test.rb index 20b9acda44..a5ae5cd8ec 100644 --- a/activerecord/test/cases/associations/has_many_associations_test.rb +++ b/activerecord/test/cases/associations/has_many_associations_test.rb @@ -1115,5 +1115,11 @@ class HasManyAssociationsTest < ActiveRecord::TestCase assert !client_association.respond_to?(:private_method) assert client_association.respond_to?(:private_method, true) end + + def test_creating_using_primary_key + firm = Firm.find(:first) + client = firm.clients_using_primary_key.create!(:name => 'test') + assert_equal firm.name, client.firm_name + end end |