forked from rails/rails
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Prevent double firing the before save callback of new object when the…
… parent association saved in the callback Related rails#18155, rails#26661, 268a5bb, rails#27434, rails#27442, and rails#28599. Originally rails#18155 was introduced for preventing double insertion caused by the after save callback. But it was caused the before save issue (rails#26661). 268a5bb fixed rails#26661, but it was caused the performance regression (rails#27434). rails#27442 added new record to `target` before calling callbacks for fixing rails#27434. But it was caused double firing before save callback (rails#28599). We cannot add new object to `target` before saving the object. This is improving rails#18155 to only track callbacks after `save`. Fixes rails#28599.
- Loading branch information
Showing
5 changed files
with
70 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters