lib/split/trial.rb in split-0.6.0 vs lib/split/trial.rb in split-0.6.1
- old
+ new
@@ -4,10 +4,10 @@
attr_accessor :goals
def initialize(attrs = {})
self.experiment = attrs[:experiment] if !attrs[:experiment].nil?
self.alternative = attrs[:alternative] if !attrs[:alternative].nil?
- self.goals = attrs[:goals] if !attrs[:goals].nil?
+ self.goals = attrs[:goals].nil? ? [] : attrs[:goals]
end
def alternative
@alternative ||= if experiment.winner
experiment.winner