{"action":"created","issue":{"url":"https://api.github.com/repos/pat/thinking-sphinx/issues/1062","repository_url":"https://api.github.com/repos/pat/thinking-sphinx","labels_url":"https://api.github.com/repos/pat/thinking-sphinx/issues/1062/labels{/name}","comments_url":"https://api.github.com/repos/pat/thinking-sphinx/issues/1062/comments","events_url":"https://api.github.com/repos/pat/thinking-sphinx/issues/1062/events","html_url":"https://github.com/pat/thinking-sphinx/issues/1062","id":245548642,"number":1062,"title":"Eager-loading associations","user":{"login":"craigsheen","id":1003739,"avatar_url":"https://avatars1.githubusercontent.com/u/1003739?v=4","gravatar_id":"","url":"https://api.github.com/users/craigsheen","html_url":"https://github.com/craigsheen","followers_url":"https://api.github.com/users/craigsheen/followers","following_url":"https://api.github.com/users/craigsheen/following{/other_user}","gists_url":"https://api.github.com/users/craigsheen/gists{/gist_id}","starred_url":"https://api.github.com/users/craigsheen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/craigsheen/subscriptions","organizations_url":"https://api.github.com/users/craigsheen/orgs","repos_url":"https://api.github.com/users/craigsheen/repos","events_url":"https://api.github.com/users/craigsheen/events{/privacy}","received_events_url":"https://api.github.com/users/craigsheen/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-07-25T22:01:51Z","updated_at":"2017-07-26T01:52:09Z","closed_at":null,"body":"Hi,\r\n\r\nI am trying to eager load an association to avoid N+1 and I have followed the docs (specifically http://freelancing-gods.com/thinking-sphinx/real_time.html) but it doesn't seem to be working.\r\n\r\nI have;\r\n```\r\nThinkingSphinx::Index.define :item, with: :real_time do\r\n  # scopes\r\n  scope { Item.preload(:user) }\r\n  # I have also tried scope { Item.includes(:user) }\r\n  ...\r\n```\r\n\r\nWhen I do this the scope doesn't seem to be used in the generated SQL and it is still then hitting the DB when doing `item.user.email`.\r\n\r\nI have looked through the issues and on google and can't seem to find anything related. Am I missing something?"},"comment":{"url":"https://api.github.com/repos/pat/thinking-sphinx/issues/comments/317923457","html_url":"https://github.com/pat/thinking-sphinx/issues/1062#issuecomment-317923457","issue_url":"https://api.github.com/repos/pat/thinking-sphinx/issues/1062","id":317923457,"user":{"login":"craigsheen","id":1003739,"avatar_url":"https://avatars1.githubusercontent.com/u/1003739?v=4","gravatar_id":"","url":"https://api.github.com/users/craigsheen","html_url":"https://github.com/craigsheen","followers_url":"https://api.github.com/users/craigsheen/followers","following_url":"https://api.github.com/users/craigsheen/following{/other_user}","gists_url":"https://api.github.com/users/craigsheen/gists{/gist_id}","starred_url":"https://api.github.com/users/craigsheen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/craigsheen/subscriptions","organizations_url":"https://api.github.com/users/craigsheen/orgs","repos_url":"https://api.github.com/users/craigsheen/repos","events_url":"https://api.github.com/users/craigsheen/events{/privacy}","received_events_url":"https://api.github.com/users/craigsheen/received_events","type":"User","site_admin":false},"created_at":"2017-07-26T01:52:09Z","updated_at":"2017-07-26T01:52:09Z","body":"Hi,\r\n\r\nYeah I was using `ts:regenerate`, but I suppose that won't work if then they update singularly after via the `after_save`?\r\n\r\nI see in https://github.com/pat/thinking-sphinx/issues/796 that there was something added around avoiding this N+1, was this actually added to the main branch and is it usable?\r\n\r\nSorry if I have misread somewhere."}}
{"actor":{"display_login":"craigsheen"}}