Automatically add `:inverse_of`

This needs the following bug in Rails fixed first:
https://github.com/rails/rails/issues/7809

Fix is in PR:
https://github.com/rails/rails/pull/7824