lib/ahoy/model.rb in ahoy_matey-2.0.0 vs lib/ahoy/model.rb in ahoy_matey-2.0.1
- old
+ new
@@ -5,10 +5,10 @@
belongs_to(name, optional: true, class_name: "Ahoy::Visit", **options)
before_create :set_ahoy_visit
end
class_eval %{
def set_ahoy_visit
- self.#{name} ||= RequestStore.store[:ahoy].try(:visit)
+ self.#{name} ||= RequestStore.store[:ahoy].try(:visit_or_create)
end
}
end
end
end