feat: Add user profile picture upload functionality #676
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.
🖼️ User Profile Picture Upload Feature
This PR implements comprehensive user profile picture upload functionality with database storage and no external infrastructure requirements.
✨ Features
🔧 Technical Implementation
Backend Changes
has_one_attached :profile_picture
with custom validationSettings::PeopleController
to handle profile picture uploadsFrontend Changes
Database
🧪 Testing
📍 Integration Points
Profile pictures automatically appear in:
_user_avatar
partial🔒 Security & Validation
🚀 Production Ready
📝 Files Changed
app/models/user.rb
- Profile picture attachment and validationapp/controllers/settings/people_controller.rb
- Upload handlingapp/views/settings/people/_form.html.erb
- Upload form UIapp/views/layouts/_user_avatar.erb
- Avatar display logicapp/javascript/stimulus/profile_picture_upload_controller.js
- Client-side functionalityapp/helpers/application_helper.rb
- Helper methods🎯 Testing Instructions
This implementation follows Rails best practices and is ready for production use.
Pull Request opened by Augment Code with guidance from the PR author