From 9d7f186f746f38367851355fcd301ac24d6f6a51 Mon Sep 17 00:00:00 2001 From: Nathaniel Talbott Date: Fri, 19 Sep 2008 16:42:18 -0400 Subject: Fixed an error triggered by a reload followed by a foreign key assignment. Signed-off-by: Michael Koziarski --- activerecord/test/cases/associations_test.rb | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'activerecord/test/cases/associations_test.rb') diff --git a/activerecord/test/cases/associations_test.rb b/activerecord/test/cases/associations_test.rb index 2050d16179..cde451de0e 100644 --- a/activerecord/test/cases/associations_test.rb +++ b/activerecord/test/cases/associations_test.rb @@ -194,6 +194,14 @@ class AssociationProxyTest < ActiveRecord::TestCase assert_equal david, welcome.author end + def test_assigning_association_id_after_reload + welcome = posts(:welcome) + welcome.reload + assert_nothing_raised do + welcome.author_id = authors(:david).id + end + end + def test_reload_returns_assocition david = developers(:david) assert_nothing_raised do -- cgit v1.2.3