I\'ve got these 5 models: Guardian, Student, Relationship, RelationshipType and School. Between them, I\'ve got these associations
class Guardian < ActiveReco
I think this should work:
FactoryGirl.define do factory :relationship do association :guardian relationship_type RelationshipType.first after_build do |relationship| relationship.student = Factory(:student, :school => relationship.guardian.school) end end end