module Arcadex module Create #This is now called by the token when it's first saved def self.generate_auth_token token = ::Devise.friendly_token while ::Arcadex::Token.exists?(:auth_token => token) token = ::Devise.friendly_token end return token end #Arcadex.create_token(instance.tokens.new,exp_minutes,request) #Put any token in here to set it's values. Usually when its first created def self.set_token(token,exp_minutes,request,max_uses) token.first_ip_address = request.remote_ip token.current_ip_address = request.remote_ip token.times_used = 0 token.expiration_minutes = exp_minutes token.max_uses = max_uses token.save return token end end end