summaryrefslogtreecommitdiff
path: root/app/experiments/require_verification_for_namespace_creation_experiment.rb
blob: 914c5c4a29e44864656dfd5bba6fe54f2176afa9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# frozen_string_literal: true

class RequireVerificationForNamespaceCreationExperiment < ApplicationExperiment
  control { false }
  candidate { true }

  exclude :existing_user

  EXPERIMENT_START_DATE = Date.new(2022, 1, 31)

  def candidate?
    run
  end

  private

  def existing_user
    return false unless user_or_actor

    user_or_actor.created_at < EXPERIMENT_START_DATE
  end
end