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.
精彩评论