-
Notifications
You must be signed in to change notification settings - Fork 21.6k
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
has_many association build/create method is overwrite forign_key #5069
Comments
I think that using I would vote for fixing it to behave like in 2.3 and throw error or show warning on try to overwrite that key. |
If you use I don't think throwing an error is a good idea. A warning would be nice. But definitely the Rails 2.3 behavior is the preferred way imho. |
Here's a fix for that issue with test cases |
Nice work! Tests and code looks good. I'm not familiar with the internals of AR but does |
Good question, I'll check that soon. |
/cc @tenderlove |
@Rohit: in fact So while I'm not absolutely sure, I think they are not affected by this change. |
Behavior of build / create method created has_many association differs by rails 2 and rails 3.0 and after rails3.1
The text was updated successfully, but these errors were encountered: