Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions lib/split/trial.rb
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,18 @@ def choose!(context = nil)

if exclude_user?
self.alternative = @experiment.control
elsif @user[@experiment.key]
self.alternative = @user[@experiment.key]
else
self.alternative = @experiment.next_alternative
value = @user[@experiment.key]
if value
self.alternative = value
else
self.alternative = @experiment.next_alternative

# Increment the number of participants since we are actually choosing a new alternative
self.alternative.increment_participation
# Increment the number of participants since we are actually choosing a new alternative
self.alternative.increment_participation

run_callback context, Split.configuration.on_trial_choose
run_callback context, Split.configuration.on_trial_choose
end
end
end

Expand Down