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]
17 self.respond_to? :uuid
21 return true if !self.respond_to_uuid?
22 return true if uuid and current_user and current_user.is_admin
23 self.uuid = [Server::Application.config.uuid_prefix,
24 self.class.uuid_prefix,
25 rand(2**256).to_s(36)[-15..-1]].