mirror of
https://github.com/apigy/selfstarter.git
synced 2026-01-09 14:27:55 -05:00
Update user.rb
This commit is contained in:
@@ -4,6 +4,8 @@ class User < ActiveRecord::Base
|
||||
before_validate :generate_uuid!, :on => :create
|
||||
|
||||
def generate_uuid!
|
||||
self.uuid = SecureRandom.hex(9)
|
||||
end
|
||||
begin
|
||||
self.uuid = SecureRandom.hex(16)
|
||||
end while Order.find_by_uuid(self.uuid).present?
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user