开发者

Using Merge Keys in Fixtures and Unique Identifier Error

开发者 https://www.devze.com 2023-03-09 07:48 出处:网络
I\'m trying to use merge keys with a Rai开发者_运维百科ls YAML fixture. I have: BOOK: &BOOK

I'm trying to use merge keys with a Rai开发者_运维百科ls YAML fixture. I have:

BOOK: &BOOK
  name: To Kill a Mocking Bird
  upc: 0215192786624

item_a:
  owner: user_a
  <<: *BOOK

item_b:
  owner: user_b
  <<: *BOOK

However, this causes Sqlite to complain on some of our development machines about duplicate identical primary keys. Any ideas? I checked and all computers are running 1.9.2 p180, and the problem happens only on about half our machines. Thanks.


I wonder if this is due to an issue with merge keys not working in ruby 1.9. More specifically the switch to the psych yaml parser:

http://redmine.ruby-lang.org/issues/show/4300


You would have to specify concrete ids on item_a and item_b.

0

精彩评论

暂无评论...
验证码 换一张
取 消