New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add UrlAttribute concern #844
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great and works exactly how I'd expect it to!
But I think we need a data migration/backfill to update all the existing records. I think this can be accomplished by saving every developer record. But we also need to make sure not to update updated_at because that is used for the "Recently active" badge.
|
I've added a migration, what do you think? The URL logic is duplicated in the migration, because migrations shouldn't depend on the current application code (that will change in the future). |
|
Sorry, I didn't mean we needed an actual Rails migration. You can throw a couple lines of a script in Does that make sense? |
# Conflicts: # lib/tasks/backfills.rake
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent - thank you!
This PR introduces
UrlAttributeconcern to removehttp(s)://protocol and custom prefix from URL attributes. It also refactors the existing logic for social profile links (github, ...).It doesn't add any URL validation because I think it's not necessary at this point. The
http(s)://protocol is not required in the submitted data, so evenasdfshould be valid, becausehttps://asdfis a valid URL.Resolves #842