Skip to content

Conversation

@NeonGamerBot-QK
Copy link
Member

No description provided.

@NeonGamerBot-QK NeonGamerBot-QK marked this pull request as ready for review December 8, 2025 04:44
@NeonGamerBot-QK NeonGamerBot-QK merged commit 4440c40 into main Dec 8, 2025
6 checks passed
@NeonGamerBot-QK NeonGamerBot-QK deleted the add-bans branch December 8, 2025 04:45
Comment on lines +163 to +165
def unban!
update!(banned: false, banned_at: nil, banned_reason: nil)
end
Copy link

Choose a reason for hiding this comment

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

Bug: unban! does not restore soft-deleted projects, leaving them hidden after unbanning.
Severity: HIGH | Confidence: High

🔍 Detailed Analysis

The unban! method only reverses the banned status of a user by updating banned, banned_at, and banned_reason fields. It does not invoke any restore operation for projects that were soft-deleted when the user was banned via the ban! method's call to soft_delete_projects!. This results in projects remaining hidden even after a user is unbanned.

💡 Suggested Fix

Modify the unban! method to call restore! on all projects associated with the user that were soft-deleted during the ban process.

🤖 Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.

Location: app/models/user.rb#L163-L165

Potential issue: The `unban!` method only reverses the `banned` status of a user by
updating `banned`, `banned_at`, and `banned_reason` fields. It does not invoke any
restore operation for projects that were soft-deleted when the user was banned via the
`ban!` method's call to `soft_delete_projects!`. This results in projects remaining
hidden even after a user is unbanned.

Did we get this right? 👍 / 👎 to inform future reviews.
Reference ID: 6038005

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants