{"action":"created","issue":{"url":"https://api.github.com/repos/ankane/ahoy/issues/276","repository_url":"https://api.github.com/repos/ankane/ahoy","labels_url":"https://api.github.com/repos/ankane/ahoy/issues/276/labels{/name}","comments_url":"https://api.github.com/repos/ankane/ahoy/issues/276/comments","events_url":"https://api.github.com/repos/ankane/ahoy/issues/276/events","html_url":"https://github.com/ankane/ahoy/issues/276","id":226476183,"number":276,"title":"Validation failed: Visit must exist","user":{"login":"jfrankov","id":46648,"avatar_url":"https://avatars0.githubusercontent.com/u/46648?v=4","gravatar_id":"","url":"https://api.github.com/users/jfrankov","html_url":"https://github.com/jfrankov","followers_url":"https://api.github.com/users/jfrankov/followers","following_url":"https://api.github.com/users/jfrankov/following{/other_user}","gists_url":"https://api.github.com/users/jfrankov/gists{/gist_id}","starred_url":"https://api.github.com/users/jfrankov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jfrankov/subscriptions","organizations_url":"https://api.github.com/users/jfrankov/orgs","repos_url":"https://api.github.com/users/jfrankov/repos","events_url":"https://api.github.com/users/jfrankov/events{/privacy}","received_events_url":"https://api.github.com/users/jfrankov/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2017-05-05T05:19:23Z","updated_at":"2017-09-26T14:39:26Z","closed_at":null,"author_association":"NONE","body":"I just installed ahoy on a rails 5 project, added this line to the create action of my controller:\r\n\r\n    ahoy.track \"Created an action\", title: \"Call\"\r\n\r\nand I get \"Validation failed: Visit must exist\". My visit.rb model already has this line in it:\r\n\r\n    belongs_to :user, optional: true\r\n\r\n...so that might not matter.\r\n\r\nAny ideas?\r\n"},"comment":{"url":"https://api.github.com/repos/ankane/ahoy/issues/comments/332220214","html_url":"https://github.com/ankane/ahoy/issues/276#issuecomment-332220214","issue_url":"https://api.github.com/repos/ankane/ahoy/issues/276","id":332220214,"user":{"login":"joshuajansen","id":68570,"avatar_url":"https://avatars2.githubusercontent.com/u/68570?v=4","gravatar_id":"","url":"https://api.github.com/users/joshuajansen","html_url":"https://github.com/joshuajansen","followers_url":"https://api.github.com/users/joshuajansen/followers","following_url":"https://api.github.com/users/joshuajansen/following{/other_user}","gists_url":"https://api.github.com/users/joshuajansen/gists{/gist_id}","starred_url":"https://api.github.com/users/joshuajansen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joshuajansen/subscriptions","organizations_url":"https://api.github.com/users/joshuajansen/orgs","repos_url":"https://api.github.com/users/joshuajansen/repos","events_url":"https://api.github.com/users/joshuajansen/events{/privacy}","received_events_url":"https://api.github.com/users/joshuajansen/received_events","type":"User","site_admin":false},"created_at":"2017-09-26T14:39:26Z","updated_at":"2017-09-26T14:39:26Z","author_association":"NONE","body":"Same here, couldn't figure out what was causing this.. Eventually I went for calling the following method `before_action`:\r\n\r\n```ruby\r\ndef ensure_visit\r\n  return if ahoy.visit\r\n  ahoy.track_visit\r\nend\r\n```"}}
{"actor":{"display_login":"joshuajansen"}}