metamaps--metamaps/app/models/token.rb
2016-03-11 17:16:04 +11:00

11 lines
177 B
Ruby

class Token < ActiveRecord::Base
belongs_to :user
before_create :generate_token
private
def generate_token
self.token = SecureRandom.uuid.gsub(/\-/,'')
end
end