lib/ahoy/model.rb in ahoy_matey-3.0.5 vs lib/ahoy/model.rb in ahoy_matey-3.1.0

- old
+ new

@@ -5,10 +5,10 @@ belongs_to(name, class_name: "Ahoy::Visit", optional: true, **options) before_create :set_ahoy_visit end class_eval %{ def set_ahoy_visit - self.#{name} ||= Thread.current[:ahoy].try(:visit_or_create) + self.#{name} ||= Ahoy.instance.try(:visit_or_create) end } end end end