lib/split/experiment.rb in split-0.7.0 vs lib/split/experiment.rb in split-0.7.1
- old
+ new
@@ -77,11 +77,10 @@
Split.redis.sadd(:experiments, name)
start unless Split.configuration.start_manually
@alternatives.reverse.each {|a| Split.redis.lpush(name, a.name)}
@goals.reverse.each {|a| Split.redis.lpush(goals_key, a)} unless @goals.nil?
else
-
existing_alternatives = load_alternatives_from_redis
existing_goals = load_goals_from_redis
unless existing_alternatives == @alternatives.map(&:name) && existing_goals == @goals
reset
@alternatives.each(&:delete)
@@ -145,9 +144,13 @@
if w = Split.redis.hget(:experiment_winner, name)
Split::Alternative.new(w, name)
else
nil
end
+ end
+
+ def has_winner?
+ !winner.nil?
end
def winner=(winner_name)
Split.redis.hset(:experiment_winner, name, winner_name.to_s)
end