Skip to content

Commit

Permalink
Added a testcase for rails#5563
Browse files Browse the repository at this point in the history
  • Loading branch information
kennyj committed Apr 2, 2012
1 parent fff3e75 commit 7c7f2fb
Showing 1 changed file with 11 additions and 0 deletions.
Expand Up @@ -704,4 +704,15 @@ def test_polymorphic_with_custom_primary_key

assert_equal toy, sponsor.reload.sponsorable
end

def test_reflect_the_most_recent_change
author1, author2 = Author.limit(2)
post = Post.new(:title => "foo", :body=> "bar")

post.author = author1
post.author_id = author2.id

assert post.save
assert_equal post.author_id, author2.id
end
end

0 comments on commit 7c7f2fb

Please sign in to comment.