This project is archived and is in readonly mode.
find_or_create_by_x with create params via association broke in 2.3.9
Reported by toby cabot | September 29th, 2010 @ 09:39 PM
Sorry about opening this bug - I'd prefer to re-open #1108 but I don't know how to do that.
The fix to #1108 added two new bugs.
Commit fad166c15277c72b370c90e890d509d0f6c9af63 (i.e. 2.3.9) broke find_or_create_by_x with additional parameters for the create, when called through an association. Since http://dev.rubyonrails.org/ticket/7368 you've been able to pass additional parameters that are ignored by the find but used by the create. fad166c broke that behavior.
fad166c also broke find_or_create_by_x with a block provided. It used to yield to the block but it doesn't anymore.
For more info please see my comments to #1108.
For convenience I'll attach the patch to this report, too.
Comments and changes to this ticket
-
David Trasbo October 10th, 2010 @ 04:54 PM
- State changed from new to duplicate
- Importance changed from to Low
I've reopened #1108. Please continue the discussion there.
-
toby cabot October 21st, 2010 @ 12:32 PM
Aaron Patterson committed the fix to #1108 so this ticket can be closed.
-
David Trasbo October 21st, 2010 @ 12:34 PM
- State changed from duplicate to resolved
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>
People watching this ticket
Attachments
Referenced by
- 1108 caching bugs in ActiveRecord#create and associations Looks like I can't re-open this bug so I've opened #5737 ...