Fixes #4607: AR model will throw an exception if it does not have a primary key to avoid updating/deleting data massively