feat: deleting stardance projects#500
Open
0xDracula wants to merge 5 commits into
Open
Conversation
Member
Author
|
these queries were used for testing soft_delete! for project & devlogs deletion: p = Project.unscoped.find(PROJECT_ID); puts "Project: #{p.title} (Deleted At: #{p.deleted_at})"; devlog_posts = Post.unscoped.where(project_id: PROJECT_ID, postable_type: 'Post::Devlog'); puts "Total Devlog Posts: #{devlog_posts.count}"; devlog_ids = devlog_posts.pluck(:postable_id); deleted_devlogs = Post::Devlog.unscoped.where(id: devlog_ids).where.not(deleted_at: nil); puts "Soft-Deleted Devlogs: #{deleted_devlogs.count}"for reposts deletion: p = Project.find(PROJECT_ID); p.soft_delete!; repost_count = Post::Repost.unscoped.where(original_post_id: p.posts.pluck(:id)).where.not(deleted_at: nil).count; puts "Project Deleted. Hidden Reposts: #{repost_count}" |
Member
Author
|
the old way was using which only marks the project as deleted ignoring the devlogs & reposts the new way marks project, devlogs & reposts as deleted |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
my plan:
this PR adds support for deleting projects through soft-deletion. currently, soft_delete! exists but it's partially implemented, and devlogs need to be marked as deleted!