X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/e19b02f69914c086f979ec31eb603bb3b456cd15..63cfe7a9b391e1a07c6c6c8b0fab10b1c875f1be:/services/api/lib/can_be_an_owner.rb?ds=sidebyside diff --git a/services/api/lib/can_be_an_owner.rb b/services/api/lib/can_be_an_owner.rb index d242b4135a..75a63509c2 100644 --- a/services/api/lib/can_be_an_owner.rb +++ b/services/api/lib/can_be_an_owner.rb @@ -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