Add comprehensive email validation for blocked users#3
Conversation
… many times each email address is blocked, and last time it was blocked. Move email validation out of User model and into EmailValidator. Signup form remembers which email addresses have failed and shows validation error on email field.
|
cursor review |
There was a problem hiding this comment.
Bugbot free trial expires on August 11, 2025
Learn more in the Cursor dashboard.
| record.save | ||
| end | ||
| record && record.action_type == actions[:block] | ||
| end |
There was a problem hiding this comment.
Bug: Query Method Causes Unintended Database Writes
The BlockedEmail.should_block? method has unintended side effects, incrementing match_count and updating last_match_at in the database. This violates the principle that query methods should be read-only. As it's called during validation (e.g., by EmailValidator), which can execute multiple times per user action (e.g., form input, failed registration attempts), it leads to inflated and inaccurate match_count statistics.
Locations (1)
|
This pull request has been automatically marked as stale because it has been open for 60 days with no activity. To keep it open, remove the stale tag, push code, or add a comment. Otherwise, it will be closed in 14 days. |
Test 3