20300: Bypass query cache when re-fetching record for race check.
[arvados.git] / services / api / app / models / authorized_key.rb
index ce348e0f8a95f47f651182c2ce49b5dfb8067962..cf4a1d55de796fd57417b8994d4c77214f8b12d8 100644 (file)
@@ -9,7 +9,12 @@ class AuthorizedKey < ArvadosModel
   before_create :permission_to_set_authorized_user_uuid
   before_update :permission_to_set_authorized_user_uuid
 
-  belongs_to :authorized_user, :foreign_key => :authorized_user_uuid, :class_name => 'User', :primary_key => :uuid
+  belongs_to :authorized_user, {
+               foreign_key: 'authorized_user_uuid',
+               class_name: 'User',
+               primary_key: 'uuid',
+               optional: true,
+             }
 
   validate :public_key_must_be_unique