Skip to content

Instantly share code, notes, and snippets.

@CapeRatel
Created June 1, 2016 16:30
Show Gist options
  • Save CapeRatel/e5648cbe80ff1fa9e684e22a2551415d to your computer and use it in GitHub Desktop.
Save CapeRatel/e5648cbe80ff1fa9e684e22a2551415d to your computer and use it in GitHub Desktop.
def generate_uuid
loop do
uuid = SecureRandom.hex(11)
break uuid unless User.find_by(uuid: uuid)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment