Factory Girl and has_many relationships

December 28, 2012

Today I was trying to figure out how to create a factory girl model, with a has_many relationship.  Turns out, this is not exactly straight-forward, and you need to read the documentation.

You should look at the (excellent) example provided in the Getting Started document on the Factory Girl wiki.

} else { $('#cookie-notice').show(); } $('#cookie-notice-accept').click(function() { createCookie('cookie-notice-dismissed','true',365); // Change from 1 month to 1 year. $('#cookie-notice').hide(); });