Skip to content
Merged
Show file tree
Hide file tree
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
6 changes: 3 additions & 3 deletions lib/split/dashboard/public/dashboard-filtering.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ $(function() {
$('#filter').on('keyup', function() {
$input = $(this);

if ($input.val() == '') {
if ($input.val() === '') {
$('div.experiment').show();
return false;
}
Expand All @@ -21,7 +21,7 @@ $(function() {

$('#toggle-active').on('click', function() {
$button = $(this);
if ($button.val() == 'Hide active') {
if ($button.val() === 'Hide active') {
$button.val('Show active');
} else {
$button.val('Hide active');
Expand All @@ -32,7 +32,7 @@ $(function() {

$('#toggle-completed').on('click', function() {
$button = $(this);
if ($button.val() == 'Hide completed') {
if ($button.val() === 'Hide completed') {
$button.val('Show completed');
} else {
$button.val('Hide completed');
Expand Down
15 changes: 7 additions & 8 deletions lib/split/experiment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,9 @@ def alternatives=(alts)
end

def winner
if w = redis.hget(:experiment_winner, name)
Split::Alternative.new(w, name)
experiment_winner = redis.hget(:experiment_winner, name)
if experiment_winner
Split::Alternative.new(experiment_winner, name)
else
nil
end
Expand Down Expand Up @@ -171,9 +172,9 @@ def start_time
if t
# Check if stored time is an integer
if t =~ /^[-+]?[0-9]+$/
t = Time.at(t.to_i)
Time.at(t.to_i)
else
t = Time.parse(t)
Time.parse(t)
end
end
end
Expand All @@ -191,7 +192,7 @@ def random_alternative
end

def version
@version ||= (redis.get("#{name.to_s}:version").to_i || 0)
@version ||= (redis.get("#{name}:version").to_i || 0)
end

def increment_version
Expand Down Expand Up @@ -280,8 +281,6 @@ def calc_winning_alternatives
end

def estimate_winning_alternative(goal = nil)
# TODO - refactor out functionality to work with and without goals

# initialize a hash of beta distributions based on the alternatives' conversion rates
beta_params = calc_beta_params(goal)

Expand Down Expand Up @@ -401,7 +400,7 @@ def experiment_config_key
end

def load_metadata_from_configuration
metadata = Split.configuration.experiment_for(@name)[:metadata]
Split.configuration.experiment_for(@name)[:metadata]
end

def load_metadata_from_redis
Expand Down