Skip to content

Instantly share code, notes, and snippets.

@cowboymathu
Created October 20, 2011 05:55
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 cowboymathu/1300521 to your computer and use it in GitHub Desktop.
Save cowboymathu/1300521 to your computer and use it in GitHub Desktop.
Factory girl association
Factory.define :user_with_role, :parent => :user do |user|
user.after_create { |p| Factory(:role, :users => [p]) }
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment