mirror of
https://github.com/apigy/selfstarter.git
synced 2026-01-09 14:27:55 -05:00
Merge pull request #50 from gmaliar/master
Removed code from User model that doesn't belong there
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user