lib/split/user.rb in split-2.1.0 vs lib/split/user.rb in split-2.2.0
- old
+ new
@@ -19,10 +19,10 @@
end
def max_experiments_reached?(experiment_key)
if Split.configuration.allow_multiple_experiments == 'control'
experiments = active_experiments
- count_control = experiments.values.count {|v| v == 'control'}
+ count_control = experiments.count {|k,v| k == experiment_key || v == 'control'}
experiments.size > count_control
else
!Split.configuration.allow_multiple_experiments &&
keys_without_experiment(user.keys, experiment_key).length > 0
end