3 def self.included(base)
4 base.extend(ClassMethods)
5 base.before_create :assign_uuid
10 Digest::MD5.hexdigest(self.to_s).to_i(16).to_s(36)[-5..-1]
13 [Server::Application.config.uuid_prefix,
15 rand(2**256).to_s(36)[-15..-1]].
23 self.respond_to? :uuid
27 return true if !self.respond_to_uuid?
28 return true if uuid and current_user and current_user.is_admin
29 self.uuid = self.class.generate_uuid