summaryrefslogtreecommitdiff
path: root/app/experiments/require_verification_for_namespace_creation_experiment.rb
blob: 1cadac7e7d46fb2af9f147f164028045169bd773 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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