# Models
class User < ActiveRecord::Base
has_many :items
end
class Items < ActiveRecord::Base
belongs_to :user
validates_presence
I usually like to separate building and creating so i can still build the object without going to the database.
Factory.define(:user_with_items, :parent => :user) do |u|
u.after_build do |u|
u.items = (1..2).map {Factory.build(:item, :user => u)}
end
u.after_create do |u|
u.items.each {|i| i.save!}
end
end