ruby on rails - FactoryGirl model's after_create not generating other models -
i have model & factory.
class user < activerecord::base has_one :emergency_contact, dependent: :destroy has_one :membership, dependent: :destroy has_one :email_settings, dependent: :destroy after_create :build_dependencies def build_dependencies build_membership build_emergency_contact build_email_settings end ... end
when run factorygirl.create :user
after_create runs, associated models aren't built , saved.
this in contrast console user.create...
build other associations.
Comments
Post a Comment