Create the dependent behaviour restrict_with_error

Causes an error to be added to the owner if there are any associated
objects.