Backport #3329 to 3-2-stable #6935

Merged
merged 1 commit into from Jul 2, 2012

Conversation

Projects
None yet
4 participants
Contributor

frodsan commented Jul 2, 2012

Fix bug with autosave collection association on new record with a marked
for destroy record in autosave collection.

Fixes #6918.

Backport #3329 to 3-2-stable
Fix bug with autosave collection association on new record with a marked
for destroy record in autosave collection.

Fixes #6918.
Owner

rafaelfranca commented Jul 2, 2012

OMG! Too much change. I'm afraid that this can introduce more bugs. Can we do a simpler change?

Contributor

frodsan commented Jul 2, 2012

@rafaelfranca No indentation? :(

Owner

rafaelfranca commented Jul 2, 2012

Ahhh, now I got. Merged. Thanks.

rafaelfranca added a commit that referenced this pull request Jul 2, 2012

@rafaelfranca rafaelfranca merged commit dacc947 into rails:3-2-stable Jul 2, 2012

It'd be nice if the collection to be operated on had its logic outside of the operations, so we don't have to follow logic like this "next" method. It seems like there are lots of different things going on here in general, also record skipping and setting a "saved" variable and then potentially acting on that variable state.

edit: this method is too large. Is it too late to refactor?

Contributor

frodsan replied Jul 26, 2012

never is too late, send a pull request :)

The code has if autosave && ... on line 342 and elsif autosave != false && ... on line 344. Why not be consistent and change line 344 to elsif autosave && ...?

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