Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
tree: f1903aba6a
Fetching contributors…

Cannot retrieve contributors at this time

13 lines (11 sloc) 0.351 kB
class User < ActiveRecord::Base
has_many :categories
has_many :envs
has_many :sites, :dependent => :destroy
has_many :tests, :class_name => 'ABTest'
has_many :variants
def before_create
chars = ("a".."z").to_a + ("A".."Z").to_a + ("0".."9").to_a
self.token ||= (1..20).collect { |i| chars[rand(chars.size-1)] }.join
end
end
Jump to Line
Something went wrong with that request. Please try again.