Skip to content

Instantly share code, notes, and snippets.

@scottwb scottwb/devise.rb
Created Dec 4, 2012

Embed
What would you like to do?
# Generate a token by looping and ensuring does not already exist.
def generate_token(column)
loop do
token = Devise.friendly_token
break token unless to_adapter.find_first({ column => token })
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.