Module: SnowmanIO::Concerns::Tokenable

Extended by:
ActiveSupport::Concern
Included in:
App, User
Defined in:
lib/snowman-io/models/concerns/tokenable.rb

Instance Method Summary collapse

Instance Method Details

#generate_token(token) ⇒ Object



6
7
8
9
10
11
# File 'lib/snowman-io/models/concerns/tokenable.rb', line 6

def generate_token(token)
  loop do
    token = SecureRandom.hex
    break token unless self.class.where(token: token).first
  end
end