Skip to content

Instantly share code, notes, and snippets.

@sideshowcoder
Created October 25, 2010 23:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sideshowcoder/646058 to your computer and use it in GitHub Desktop.
Save sideshowcoder/646058 to your computer and use it in GitHub Desktop.
1 to many factory model
Factory.define :coffeeshop do |s|
s.sequence(:location) { |n| "town#{n}"}
end
Factory.define :coffee do |c|
c.sequence(:name) { |n| "coffee#{n}"}
c.tried false
c.association :coffeeshop
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment