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

Delete messages without instantiating ActiveRecord objects #4183

Merged
merged 1 commit into from
Oct 8, 2019

Conversation

arku
Copy link
Contributor

@arku arku commented Oct 2, 2019

What type of PR is this? (check all applicable)

  • Refactor
  • Feature
  • Bug Fix
  • Documentation Update

Description

Favors delete_all over destroy in a deleting a collection of Messages. The former is efficient as it doesn't instantiate any ActiveRecord objects. Since the Message model has no before_destroy callbacks, I believe it's safe to use delete_all. Do let me know if I am missing something.

Added to documentation?

  • docs.dev.to
  • readme
  • no documentation needed

@pr-triage pr-triage bot added the PR: unreviewed bot applied label for PR's with no review label Oct 2, 2019
@rhymes rhymes requested a review from maestromac October 2, 2019 09:18
Copy link
Contributor

@maestromac maestromac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this is indeed a safe procedure but I'm going to defer this to @benhalpern

@pr-triage pr-triage bot added PR: reviewed-approved bot applied label for PR's where reviewer approves changes and removed PR: unreviewed bot applied label for PR's with no review labels Oct 8, 2019
@maestromac maestromac requested a review from benhalpern October 8, 2019 21:21
@benhalpern benhalpern merged commit 08f397b into forem:master Oct 8, 2019
@pr-triage pr-triage bot added PR: merged bot applied label for PR's that are merged and removed PR: reviewed-approved bot applied label for PR's where reviewer approves changes labels Oct 8, 2019
@arku arku deleted the perfomance/messages-deletion branch October 8, 2019 21:46
RakChamp25 pushed a commit to RakChamp25/dev.to that referenced this pull request Oct 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: merged bot applied label for PR's that are merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants