Fix HasManyAssociation#create ignoring the :primary_key option [#1633 state:resolved]

Signed-off-by: Frederick Cheung <frederick.cheung@gmail.com>
This commit is contained in:
Roman Shterenzon
2008-12-27 01:10:29 +00:00
committed by Frederick Cheung
parent f9cab0e503
commit 21efba464a
2 changed files with 10 additions and 1 deletions

View File

@@ -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