summaryrefslogtreecommitdiff
path: root/app/experiments/members/invite_email_experiment.rb
blob: 58703fd505db86a7d1fc063e41bd822b4f36a1d8 (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

module Members
  class InviteEmailExperiment < ApplicationExperiment
    exclude { context.actor.created_by.blank? }
    exclude { context.actor.created_by.avatar_url.nil? }

    INVITE_TYPE = 'initial_email'

    private

    def resolve_variant_name
      # we are overriding here so that when we add another experiment
      # we can merely add that variant and check of feature flag here
      if Feature.enabled?(feature_flag_name, self, type: :experiment, default_enabled: :yaml)
        :avatar
      else
        nil # :control
      end
    end
  end
end