阅读背景:

在带有唯一约束的关联的Rails中使用factory_girl。让重复的错误

来源:互联网 

I'm working with a Rails 2.2 project working to update it. I'm replacing existing fixtures with factories (using factory_girl) and have had some issues. The problem is with models that represent tables with lookup data. When I create a Cart with two products that have the same product type, each created product is re-creating the same product type. This errors from a unique validation on the ProductType model.I'm working with a Rails 2.2 project working to




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: