Skip to content

Instantly share code, notes, and snippets.

@jasonswett
Created September 14, 2012 20:45
Show Gist options
  • Save jasonswett/3724688 to your computer and use it in GitHub Desktop.
Save jasonswett/3724688 to your computer and use it in GitHub Desktop.
FactoryGirl.define do
factory :employee do
# Your callback can be either for :build or :create, whichever
# makes the most sense for your situation.
after(:build) { |instance| instance.skills << create_list(:skill, 5) }
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment