In a Rails application, given three models User, Article and Reviewer with the following relationships and validations:
class User < ActiveRecord::Base has_
factory :article do reviewers {|a| [a.association(:reviewer)] } end
or
factory :article do before_create do |a| FactoryGirl.create(:reviewer, article: a) end end