Applying rewriteIds on foreign keys on find() and destroy()