21504: Rewrite arv-mount help for more consistent style
[arvados.git] / services / api / lib / has_uuid.rb
index 60db53d5e687440f4297b0ea29fc5893e52cf68c..217113beec34d8193bce89c7cf5c9517ada014fa 100644 (file)
@@ -14,14 +14,14 @@ module HasUuid
     base.has_many(:links_via_head,
                   -> { where("not (link_class = 'permission')") },
                   class_name: 'Link',
-                  foreign_key: :head_uuid,
-                  primary_key: :uuid,
+                  foreign_key: 'head_uuid',
+                  primary_key: 'uuid',
                   dependent: :destroy)
     base.has_many(:links_via_tail,
                   -> { where("not (link_class = 'permission')") },
                   class_name: 'Link',
-                  foreign_key: :tail_uuid,
-                  primary_key: :uuid,
+                  foreign_key: 'tail_uuid',
+                  primary_key: 'uuid',
                   dependent: :destroy)
   end
 
@@ -30,7 +30,7 @@ module HasUuid
       Digest::MD5.hexdigest(self.to_s).to_i(16).to_s(36)[-5..-1]
     end
     def generate_uuid
-      [Server::Application.config.uuid_prefix,
+      [Rails.configuration.ClusterID,
        self.uuid_prefix,
        rand(2**256).to_s(36)[-15..-1]].
         join '-'