Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Saving a parent precludes modifying an association #297

Open
martinstreicher opened this issue Sep 3, 2012 · 0 comments
Open

Saving a parent precludes modifying an association #297

martinstreicher opened this issue Sep 3, 2012 · 0 comments

Comments

@martinstreicher
Copy link

If I change line 12 in associations_spec.rb to

@post        = Post.create(:title => "Hello, world!")

(that is, from .new to .create), the code in line 18...

@post.comments << @comment_one << @comment_two

... fails. If, however, I change line 12 to:

@post        = Post.create(:title => "Hello, world!", :comments => [])

... then all is well.

This makes coding a little mind-bending.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant