Skip to content

Instantly share code, notes, and snippets.

@kirkconnell
Created February 19, 2011 00:50
Show Gist options
  • Save kirkconnell/834694 to your computer and use it in GitHub Desktop.
Save kirkconnell/834694 to your computer and use it in GitHub Desktop.
Factory.define :wisconsin_profile_with_products, :parent => :state_profile do |f|
f.primary_address { Factory.create(:primary_address) }
f.after_create do |profile|
product = Factory.create(:product_in_wisconsin, :site => profile.site)
profile.locations << product.locations
profile.entity.products << product
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment