Fix infinite recursion

The method for testing whether to include an association was causing
an infinite loop when two models referenced each other.
This commit is contained in:
Gary Gordon
2014-11-07 09:28:10 -05:00
parent 95d122046d
commit d97b2f5005
9 changed files with 54 additions and 13 deletions

View File

@@ -7,6 +7,7 @@ module ActiveModel
class BelongsToTest < Minitest::Test
def setup
@author = Author.new(id: 1, name: 'Steve K.')
@author.bio = nil
@post = Post.new(id: 42, title: 'New Post', body: 'Body')
@anonymous_post = Post.new(id: 43, title: 'Hello!!', body: 'Hello, world!!')
@comment = Comment.new(id: 1, body: 'ZOMG A COMMENT')