From cbf647d8c2954453ba106ac14a82bb0fcf294b04 Mon Sep 17 00:00:00 2001 From: Stuart Owen Date: Fri, 25 Oct 2024 13:59:39 +0100 Subject: [PATCH] change factory back #2020 --- test/factories/observation_units.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/factories/observation_units.rb b/test/factories/observation_units.rb index a5b130a87c..6310a82552 100644 --- a/test/factories/observation_units.rb +++ b/test/factories/observation_units.rb @@ -5,7 +5,7 @@ policy { FactoryBot.create(:public_policy) } association :contributor, factory: :person, strategy: :create after(:build) do |a| - a.study = FactoryBot.create(:study, contributor: a.contributor) if a.study.nil? + a.study ||= FactoryBot.create(:study, contributor: a.contributor) end end