@jvanbaarsen you about
``` ruby
belongs_to :group,        foreign_key: :namespace_id, -> { where(type: Group) }
```
?