Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
dependent: :destroy should call destroy_all
Commit #9668 shows warning when `delete_all` is invoked with `:dependent` option `:destroy`. Unfortunately invoking `Post.destroy_all` invokes `post.comments.delete_all` as part of `has_many` callbacks. This commit ensures that instead `post.comments.destroy_all` is invoked and in the process no warning is generated. See issue #9567 for details .
- Loading branch information
c3829d3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@neerajdotname no tests? 😄
c3829d3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@spastorino There was no change in functionality.
@post.comments.destroy_all
was callingdelete_all
. And@post.comments.delete_all
also callsdelete_all
.Since we added warning message in
delete_all
nowPost.destroy_all
started showing warnings. This was the fix for not displaying the warning forPost.destroy_all
.