Commit 4edd7702 authored by Heinrich Lee Yu's avatar Heinrich Lee Yu Committed by Peter Leitzen

Set pipeline CI ref in before(:create)

This hook only sets the value of the attribute so having it in the after
hook means that the value is set on the model but it is not persisted to
the DB
parent e5c67baa
......@@ -23,7 +23,7 @@ FactoryBot.define do
factory :ci_pipeline do
transient { ci_ref_presence { true } }
after(:build) do |pipeline, evaluator|
before(:create) do |pipeline, evaluator|
pipeline.ensure_ci_ref! if evaluator.ci_ref_presence && pipeline.ci_ref_id.nil?
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment