0
我有一個驗證它的蛞蝓都是獨一無二的,像這樣一個Rails模型:的Rails:顯示驗證獨特性,當複製
validates_uniqueness_of :slug
批量導入過程中,我獲得了大量的驗證失敗,並有屏幕錯誤是這樣的:
ERROR: invalid() - Validation failed: Slug has already been taken
ERROR: invalid() - Validation failed: Slug has already been taken
ERROR: invalid() - Validation failed: Slug has already been taken
...
我想有錯誤消息顯示哪些slugs失敗驗證。如何才能做到這一點?