Commit b1f14036 authored by Jay's avatar Jay Committed by Doug Stull

Ensure variant when creating ExperimentSubjects

parent 9d8d82ec
......@@ -32,8 +32,8 @@ class ApplicationExperiment < Gitlab::Experiment # rubocop:disable Gitlab/Namesp
subject = value[:namespace] || value[:group] || value[:project] || value[:user] || value[:actor]
return unless ExperimentSubject.valid_subject?(subject)
variant = :experimental if @variant_name != :control
Experiment.add_subject(name, variant: variant || :control, subject: subject)
variant_name = :experimental if variant&.name != 'control'
Experiment.add_subject(name, variant: variant_name || :control, subject: subject)
end
def record!
......
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