Update user.rb

This commit is contained in:
Jarred Sumner
2013-04-10 12:15:28 -07:00
parent cbdbc4959c
commit aea5b165da

View File

@@ -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