The problem here is migrations. The attribute os_family was not there since the beginning. It's added by a migration. But we use the partition table model in some of the earlier migrations. When I add the validation the whole migration starts failing on "unknown attribute os_family".
I'm not sure if what I just wrote is intelligible...