lib/optimizely_server_side/experiment.rb
# Selects and calls the variation which is applicable
# In case of running test the applicable variation key is present
# In case of fallback / paused test we pick the primary variation
Selects and calls the variation which is applicable
In case of running test the applicable variation key is present
In case of fallback / paused test we pick the primary variation
Selects and calls the variation which is applicable In case of running test the applicable variation key is present In case of fallback / paused test we pick the primary variation
def applicable_variation
      ActiveSupport::Notifications.instrument "oss.variation", variation: @selected_variation_key, experiment: @experiment_key, visitor_id: OptimizelyServerSide.configuration.user_attributes['visitor_id'] do
        if @variations.any?(&variation_selector)
          @variations.find(&variation_selector).call
        else
          primary_variation.call if primary_variation
        end
      end
    end
def applicable_variation ActiveSupport :: Notifications . instrument "oss.variation" , variation : @selected_variation_key , experiment : @experiment_key , visitor_id : OptimizelyServerSide . configuration . user_attributes [ 'visitor_id' ] do if @variations . any? ( & variation_selector ) @variations . find ( & variation_selector ) . call else primary_variation . call if primary_variation end end end
Selects and calls the variation which is applicable
In case of running test the applicable variation key is present
In case of fallback / paused test we pick the primary variation
Selects and calls the variation which is applicable In case of running test the applicable variation key is present In case of fallback / paused test we pick the primary variation