{"action":"created","issue":{"url":"https://api.github.com/repos/thredded/thredded/issues/206","repository_url":"https://api.github.com/repos/thredded/thredded","labels_url":"https://api.github.com/repos/thredded/thredded/issues/206/labels{/name}","comments_url":"https://api.github.com/repos/thredded/thredded/issues/206/comments","events_url":"https://api.github.com/repos/thredded/thredded/issues/206/events","html_url":"https://github.com/thredded/thredded/pull/206","id":146996749,"number":206,"title":"Refactor search","user":{"login":"glebm","id":216339,"avatar_url":"https://avatars.githubusercontent.com/u/216339?v=3","gravatar_id":"","url":"https://api.github.com/users/glebm","html_url":"https://github.com/glebm","followers_url":"https://api.github.com/users/glebm/followers","following_url":"https://api.github.com/users/glebm/following{/other_user}","gists_url":"https://api.github.com/users/glebm/gists{/gist_id}","starred_url":"https://api.github.com/users/glebm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/glebm/subscriptions","organizations_url":"https://api.github.com/users/glebm/orgs","repos_url":"https://api.github.com/users/glebm/repos","events_url":"https://api.github.com/users/glebm/events{/privacy}","received_events_url":"https://api.github.com/users/glebm/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/thredded/thredded/labels/in%20progress","name":"in progress","color":"ededed"}],"state":"open","locked":false,"assignee":{"login":"jayroh","id":28194,"avatar_url":"https://avatars.githubusercontent.com/u/28194?v=3","gravatar_id":"","url":"https://api.github.com/users/jayroh","html_url":"https://github.com/jayroh","followers_url":"https://api.github.com/users/jayroh/followers","following_url":"https://api.github.com/users/jayroh/following{/other_user}","gists_url":"https://api.github.com/users/jayroh/gists{/gist_id}","starred_url":"https://api.github.com/users/jayroh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jayroh/subscriptions","organizations_url":"https://api.github.com/users/jayroh/orgs","repos_url":"https://api.github.com/users/jayroh/repos","events_url":"https://api.github.com/users/jayroh/events{/privacy}","received_events_url":"https://api.github.com/users/jayroh/received_events","type":"User","site_admin":false},"milestone":null,"comments":3,"created_at":"2016-04-08T18:03:21Z","updated_at":"2016-04-08T20:06:24Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/thredded/thredded/pulls/206","html_url":"https://github.com/thredded/thredded/pull/206","diff_url":"https://github.com/thredded/thredded/pull/206.diff","patch_url":"https://github.com/thredded/thredded/pull/206.patch"},"body":"1. Use active_record_union to avoid manual SQL building.\r\n\r\n   This avoids the `select id` subselect, making the query faster.\r\n\r\n   This also allows us to return the scope, allowing to remove order and\r\n   limit concerns from the search class. The controller now appends the\r\n   order, so another Search implementation could still use its own\r\n   order.\r\n\r\n2. Removes usage of an exception for control flow."},"comment":{"url":"https://api.github.com/repos/thredded/thredded/issues/comments/207581599","html_url":"https://github.com/thredded/thredded/pull/206#issuecomment-207581599","issue_url":"https://api.github.com/repos/thredded/thredded/issues/206","id":207581599,"user":{"login":"glebm","id":216339,"avatar_url":"https://avatars.githubusercontent.com/u/216339?v=3","gravatar_id":"","url":"https://api.github.com/users/glebm","html_url":"https://github.com/glebm","followers_url":"https://api.github.com/users/glebm/followers","following_url":"https://api.github.com/users/glebm/following{/other_user}","gists_url":"https://api.github.com/users/glebm/gists{/gist_id}","starred_url":"https://api.github.com/users/glebm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/glebm/subscriptions","organizations_url":"https://api.github.com/users/glebm/orgs","repos_url":"https://api.github.com/users/glebm/repos","events_url":"https://api.github.com/users/glebm/events{/privacy}","received_events_url":"https://api.github.com/users/glebm/received_events","type":"User","site_admin":false},"created_at":"2016-04-08T20:06:24Z","updated_at":"2016-04-08T20:06:24Z","body":"This is good to review. Good call on tests, caught a couple of bugs.\r\nChanges since the previous review are in the commit titles."}}