lib/verdict/assignment.rb in verdict-0.4.1 vs lib/verdict/assignment.rb in verdict-0.5.0
- old
+ new
@@ -1,14 +1,13 @@
class Verdict::Assignment
-
attr_reader :experiment, :subject_identifier, :group, :created_at
def initialize(experiment, subject_identifier, group, originally_created_at, temporary = false)
@experiment = experiment
@subject_identifier = subject_identifier
@group = group
- @returning = !originally_created_at.nil?
+ @first = originally_created_at.nil? || experiment.manual_assignment_timestamps?
@created_at = originally_created_at || Time.now.utc
@temporary = temporary
end
def subject
@@ -30,10 +29,10 @@
def returning
self.class.new(@experiment, @subject_identifier, @group, @created_at)
end
def returning?
- @returning
+ @first.nil?
end
def handle
qualified? ? group.handle : nil
end