This project is archived and is in readonly mode.

#5737 ✓resolved
toby cabot

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

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

Pages