Rails 4, RSpec, MySQL2 default value error on first factory only

浪子不回头ぞ 提交于 2019-12-04 21:59:17

I found the answer to this issue. The legacy database did not set the id field to auto-increment. As a result, database_cleaner was having trouble cleaning the test suite db. The solution was to add self.primary_key = 'id' to my Upload model.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!