I like the announced ‘foxy fixtures’ Rails 2.0 idea a lot and tried to use it but found that some things broke immediately.
After some investigation I found that you it doesn’t work if you specify primary key for fixture object that is used in another fixture object.

I.e. this works:

# sellers.yml
shopify:
name: Shopify

# products.yml
pimp_cup:
seller: shopify
name: Pimp cup

# foxy_test.rb
products(:pimp_cup).seller.nil?
=> false #that's right

And this doesn’t:

# sellers.yml
shopify:
id: 8
name: Shopify

# products.yml
pimp_cup:
seller: shopify
name: Pimp cup

# foxy_test.rb
products(:pimp_cup).seller.nil?
=> true #wtf??

And it appears to be even documented in AR’s changelog, so it’s questionable whether it worth a blog entry – well let’s pretend I’m a blogger )



No Responses Yet to “Foxy fixtures hate ids”  

  1. No Comments Yet

Leave a Reply