diff options
Diffstat (limited to 'app/experiments/require_verification_for_namespace_creation_experiment.rb')
-rw-r--r-- | app/experiments/require_verification_for_namespace_creation_experiment.rb | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/app/experiments/require_verification_for_namespace_creation_experiment.rb b/app/experiments/require_verification_for_namespace_creation_experiment.rb new file mode 100644 index 00000000000..1cadac7e7d4 --- /dev/null +++ b/app/experiments/require_verification_for_namespace_creation_experiment.rb @@ -0,0 +1,27 @@ +# frozen_string_literal: true + +class RequireVerificationForNamespaceCreationExperiment < ApplicationExperiment # rubocop:disable Gitlab/NamespacedClass + def control_behavior + false + end + + def candidate_behavior + true + end + + def candidate? + run + end + + def record_conversion(namespace) + return unless should_track? + + Experiment.by_name(name).record_conversion_event_for_subject(subject, namespace_id: namespace.id) + end + + private + + def subject + context.value[:user] + end +end |