Merge pull request #50 from gmaliar/master

Removed code from User model that doesn't belong there
This commit is contained in:
Jarred Sumner
2013-04-26 14:11:50 -07:00

View File

@@ -1,13 +1,4 @@
class User < ActiveRecord::Base
attr_accessible :email
has_many :orders
before_validation :generate_uuid!, :on => :create
validates_presence_of :uuid
self.primary_key = 'uuid'
def generate_uuid!
begin
self.uuid = SecureRandom.hex(16)
end while Order.find_by_uuid(self.uuid).present?
end
end