Created
May 11, 2018 18:31
-
-
Save nenadjaja/224135ec5e1fbe414efe5ba77d349152 to your computer and use it in GitHub Desktop.
cut bio
This file contains 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
Profile.all.each do |profile| | |
if (profile.bio && profile.bio.length > 800) | |
new_bio = profile.bio[0..798].split('.') | |
new_bio.pop if new_bio.size > 1 | |
updated = new_bio.join() + '.' | |
profile.update(bio: updated) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment