Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documented issue related before_destroy with dependent: :destroy #28680

Merged
merged 1 commit into from Apr 10, 2017

Conversation

@vishalzambre
Copy link
Contributor

@vishalzambre vishalzambre commented Apr 6, 2017

To address issues #3458, #20954, #670 It is good to have documented it at http://edgeguides.rubyonrails.org/active_record_callbacks.html

@rails-bot
Copy link

@rails-bot rails-bot commented Apr 6, 2017

Thanks for the pull request, and welcome! The Rails team is excited to review your changes, and you should hear from @eileencodes (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

This repository is being automatically checked for code quality issues using Code Climate. You can see results for this analysis in the PR status below. Newly introduced issues should be fixed before a Pull Request is considered ready to review.

Please see the contribution instructions for more information.

@vishalzambre vishalzambre force-pushed the vishalzambre:callback_doc_update branch Apr 6, 2017
Copy link
Member

@maclover7 maclover7 left a comment

Please update the text per my comment. Thank you for the PR!

guides/source/active_record_callbacks.md Outdated
@@ -117,6 +117,8 @@ Here is a list with all the available Active Record callbacks, listed in the sam

WARNING. `after_save` runs both on create and update, but always _after_ the more specific callbacks `after_create` and `after_update`, no matter the order in which the macro calls were executed.

NOTE: `before_destroy` should placed before `dependent: :destroy` associations or use `prepend: true` to execute it before `dependent: :destroy`

This comment has been minimized.

@maclover7

maclover7 Apr 8, 2017
Member

before_destroy callback should be placed before dependent: :destroy associations (or use the prepend: true option), to ensure they execute before the records are deleted by dependent: :destroy.

@maclover7
Copy link
Member

@maclover7 maclover7 commented Apr 8, 2017

@rails-bot rails-bot assigned maclover7 and unassigned eileencodes Apr 8, 2017
@vishalzambre
Copy link
Contributor Author

@vishalzambre vishalzambre commented Apr 9, 2017

@maclover7 Updated text as per comment.

@maclover7
Copy link
Member

@maclover7 maclover7 commented Apr 10, 2017

Thanks @vishalzambre! Can you squash down your commits to one, and add [ci skip] to the commit message? Looks ready to merge after that.

Updated text
@vishalzambre vishalzambre force-pushed the vishalzambre:callback_doc_update branch to a1d1675 Apr 10, 2017
@vishalzambre
Copy link
Contributor Author

@vishalzambre vishalzambre commented Apr 10, 2017

@maclover7 squashed changes.

@maclover7 maclover7 removed the needs work label Apr 10, 2017
@maclover7
Copy link
Member

@maclover7 maclover7 commented Apr 10, 2017

👍 Thank you for your contribution!

❤️ 💚 💙 💛 💜

@maclover7 maclover7 merged commit e8ee218 into rails:master Apr 10, 2017
1 check passed
1 check passed
codeclimate no new or fixed issues
Details
@mstroming
Copy link
Contributor

@mstroming mstroming commented Oct 11, 2017

@vishalzambre @maclover7 I see this documented in the Edge guide, but not here:

http://guides.rubyonrails.org/active_record_callbacks.html

What's the difference between those two guides? When people are Googling for this stuff, they're not automatically going to understand the difference.

@vishalzambre vishalzambre deleted the vishalzambre:callback_doc_update branch Dec 8, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

5 participants
You can’t perform that action at this time.