fix(avatar): handle nil email with fallback to member-ID-based placeholder#2583
Merged
mroderick merged 1 commit intocodebar:masterfrom Apr 22, 2026
Merged
Conversation
…older
Fixes ActionView::Template::Error: undefined method 'strip' for nil
when rendering avatar for members with nil email.
- Extract MD5 hashing into new DigestHelper md5_of method
- Refactor Member#avatar to use fallback email (member-{id}@example.com)
when member.email is nil
- Remove deprecated md5_email method from Member
- Add tests for md5_of helper and nil email fallback in avatar
Refs: https://app.rollbar.com/a/codebar-production/fix/item/codebar-production/676
KimberleyCook
approved these changes
Apr 22, 2026
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.
This was re-introduced when we null'ed invalid email addresses in the database in recent work fixing sending out email invites for workshops.
Summary
ActionView::Template::Error: undefined method 'strip' for nilwhen rendering avatar for members with nil emailDigestHelper#md5_ofhelper (pure function)Member#avatarto use fallback email (member-{id}@example.com) when member.email is nilMember#md5_emailmethodError
Refs: https://app.rollbar.com/a/codebar-production/fix/item/codebar-production/676
Testing
md5_ofhelper inspec/helpers/application_helper_spec.rbspec/models/member_spec.rb