Skip to content

Instantly share code, notes, and snippets.

@nenadjaja
Created May 11, 2018 18:31
Show Gist options
  • Save nenadjaja/224135ec5e1fbe414efe5ba77d349152 to your computer and use it in GitHub Desktop.
Save nenadjaja/224135ec5e1fbe414efe5ba77d349152 to your computer and use it in GitHub Desktop.
cut bio
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