Merge branch '9005-keep-http-client'
[arvados.git] / services / api / lib / can_be_an_owner.rb
index d242b4135a92fa730b5c4bcc0c35fdf09d9a894c..75a63509c206ac86fa64e39afa990073350a87cb 100644 (file)
@@ -1,4 +1,5 @@
-# Protect 
+# Protect referential integrity of owner_uuid columns in other tables
+# that can refer to the uuid column in this table.
 
 module CanBeAnOwner
 
@@ -13,7 +14,7 @@ module CanBeAnOwner
       base.has_many(t.to_sym,
                     foreign_key: :owner_uuid,
                     primary_key: :uuid,
-                    dependent: :restrict)
+                    dependent: :restrict_with_exception)
     end
     # We need custom protection for changing an owner's primary
     # key. (Apart from this restriction, admins are allowed to change