{"action":"closed","number":28,"pull_request":{"url":"https://api.github.com/repos/nathanl/searchlight/pulls/28","id":33131729,"html_url":"https://github.com/nathanl/searchlight/pull/28","diff_url":"https://github.com/nathanl/searchlight/pull/28.diff","patch_url":"https://github.com/nathanl/searchlight/pull/28.patch","issue_url":"https://api.github.com/repos/nathanl/searchlight/issues/28","number":28,"state":"closed","locked":false,"title":"Use `.scoped` instead of `.all`.","user":{"login":"joshuapinter","id":180819,"avatar_url":"https://avatars.githubusercontent.com/u/180819?v=3","gravatar_id":"","url":"https://api.github.com/users/joshuapinter","html_url":"https://github.com/joshuapinter","followers_url":"https://api.github.com/users/joshuapinter/followers","following_url":"https://api.github.com/users/joshuapinter/following{/other_user}","gists_url":"https://api.github.com/users/joshuapinter/gists{/gist_id}","starred_url":"https://api.github.com/users/joshuapinter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joshuapinter/subscriptions","organizations_url":"https://api.github.com/users/joshuapinter/orgs","repos_url":"https://api.github.com/users/joshuapinter/repos","events_url":"https://api.github.com/users/joshuapinter/events{/privacy}","received_events_url":"https://api.github.com/users/joshuapinter/received_events","type":"User","site_admin":false},"body":"`.all` will run the query while `.scoped` will return an `ActiveRecord::Relation` and lazy-load it as necessary.","created_at":"2015-04-13T02:12:14Z","updated_at":"2015-04-23T17:59:41Z","closed_at":"2015-04-23T17:59:41Z","merged_at":null,"merge_commit_sha":"b311c9684984e56c17b913dec6f62d0be201ed74","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/nathanl/searchlight/pulls/28/commits","review_comments_url":"https://api.github.com/repos/nathanl/searchlight/pulls/28/comments","review_comment_url":"https://api.github.com/repos/nathanl/searchlight/pulls/comments{/number}","comments_url":"https://api.github.com/repos/nathanl/searchlight/issues/28/comments","statuses_url":"https://api.github.com/repos/nathanl/searchlight/statuses/79142072382f1496055e0ee0910364345f4438bf","head":{"label":"joshuapinter:patch-1","ref":"patch-1","sha":"79142072382f1496055e0ee0910364345f4438bf","user":{"login":"joshuapinter","id":180819,"avatar_url":"https://avatars.githubusercontent.com/u/180819?v=3","gravatar_id":"","url":"https://api.github.com/users/joshuapinter","html_url":"https://github.com/joshuapinter","followers_url":"https://api.github.com/users/joshuapinter/followers","following_url":"https://api.github.com/users/joshuapinter/following{/other_user}","gists_url":"https://api.github.com/users/joshuapinter/gists{/gist_id}","starred_url":"https://api.github.com/users/joshuapinter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joshuapinter/subscriptions","organizations_url":"https://api.github.com/users/joshuapinter/orgs","repos_url":"https://api.github.com/users/joshuapinter/repos","events_url":"https://api.github.com/users/joshuapinter/events{/privacy}","received_events_url":"https://api.github.com/users/joshuapinter/received_events","type":"User","site_admin":false},"repo":{"id":33842962,"name":"searchlight","full_name":"joshuapinter/searchlight","owner":{"login":"joshuapinter","id":180819,"avatar_url":"https://avatars.githubusercontent.com/u/180819?v=3","gravatar_id":"","url":"https://api.github.com/users/joshuapinter","html_url":"https://github.com/joshuapinter","followers_url":"https://api.github.com/users/joshuapinter/followers","following_url":"https://api.github.com/users/joshuapinter/following{/other_user}","gists_url":"https://api.github.com/users/joshuapinter/gists{/gist_id}","starred_url":"https://api.github.com/users/joshuapinter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joshuapinter/subscriptions","organizations_url":"https://api.github.com/users/joshuapinter/orgs","repos_url":"https://api.github.com/users/joshuapinter/repos","events_url":"https://api.github.com/users/joshuapinter/events{/privacy}","received_events_url":"https://api.github.com/users/joshuapinter/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/joshuapinter/searchlight","description":"Searchlight helps you build searches from options via Ruby methods that you write.","fork":true,"url":"https://api.github.com/repos/joshuapinter/searchlight","forks_url":"https://api.github.com/repos/joshuapinter/searchlight/forks","keys_url":"https://api.github.com/repos/joshuapinter/searchlight/keys{/key_id}","collaborators_url":"https://api.github.com/repos/joshuapinter/searchlight/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/joshuapinter/searchlight/teams","hooks_url":"https://api.github.com/repos/joshuapinter/searchlight/hooks","issue_events_url":"https://api.github.com/repos/joshuapinter/searchlight/issues/events{/number}","events_url":"https://api.github.com/repos/joshuapinter/searchlight/events","assignees_url":"https://api.github.com/repos/joshuapinter/searchlight/assignees{/user}","branches_url":"https://api.github.com/repos/joshuapinter/searchlight/branches{/branch}","tags_url":"https://api.github.com/repos/joshuapinter/searchlight/tags","blobs_url":"https://api.github.com/repos/joshuapinter/searchlight/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/joshuapinter/searchlight/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/joshuapinter/searchlight/git/refs{/sha}","trees_url":"https://api.github.com/repos/joshuapinter/searchlight/git/trees{/sha}","statuses_url":"https://api.github.com/repos/joshuapinter/searchlight/statuses/{sha}","languages_url":"https://api.github.com/repos/joshuapinter/searchlight/languages","stargazers_url":"https://api.github.com/repos/joshuapinter/searchlight/stargazers","contributors_url":"https://api.github.com/repos/joshuapinter/searchlight/contributors","subscribers_url":"https://api.github.com/repos/joshuapinter/searchlight/subscribers","subscription_url":"https://api.github.com/repos/joshuapinter/searchlight/subscription","commits_url":"https://api.github.com/repos/joshuapinter/searchlight/commits{/sha}","git_commits_url":"https://api.github.com/repos/joshuapinter/searchlight/git/commits{/sha}","comments_url":"https://api.github.com/repos/joshuapinter/searchlight/comments{/number}","issue_comment_url":"https://api.github.com/repos/joshuapinter/searchlight/issues/comments{/number}","contents_url":"https://api.github.com/repos/joshuapinter/searchlight/contents/{+path}","compare_url":"https://api.github.com/repos/joshuapinter/searchlight/compare/{base}...{head}","merges_url":"https://api.github.com/repos/joshuapinter/searchlight/merges","archive_url":"https://api.github.com/repos/joshuapinter/searchlight/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/joshuapinter/searchlight/downloads","issues_url":"https://api.github.com/repos/joshuapinter/searchlight/issues{/number}","pulls_url":"https://api.github.com/repos/joshuapinter/searchlight/pulls{/number}","milestones_url":"https://api.github.com/repos/joshuapinter/searchlight/milestones{/number}","notifications_url":"https://api.github.com/repos/joshuapinter/searchlight/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/joshuapinter/searchlight/labels{/name}","releases_url":"https://api.github.com/repos/joshuapinter/searchlight/releases{/id}","created_at":"2015-04-13T02:10:02Z","updated_at":"2015-04-13T02:10:03Z","pushed_at":"2015-04-13T02:12:07Z","git_url":"git://github.com/joshuapinter/searchlight.git","ssh_url":"git@github.com:joshuapinter/searchlight.git","clone_url":"https://github.com/joshuapinter/searchlight.git","svn_url":"https://github.com/joshuapinter/searchlight","homepage":"https://github.com/nathanl/searchlight","size":251,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"nathanl:master","ref":"master","sha":"a8a72b5a2ee72572a0887a39d75c2bbc5a5133dc","user":{"login":"nathanl","id":338814,"avatar_url":"https://avatars.githubusercontent.com/u/338814?v=3","gravatar_id":"","url":"https://api.github.com/users/nathanl","html_url":"https://github.com/nathanl","followers_url":"https://api.github.com/users/nathanl/followers","following_url":"https://api.github.com/users/nathanl/following{/other_user}","gists_url":"https://api.github.com/users/nathanl/gists{/gist_id}","starred_url":"https://api.github.com/users/nathanl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nathanl/subscriptions","organizations_url":"https://api.github.com/users/nathanl/orgs","repos_url":"https://api.github.com/users/nathanl/repos","events_url":"https://api.github.com/users/nathanl/events{/privacy}","received_events_url":"https://api.github.com/users/nathanl/received_events","type":"User","site_admin":false},"repo":{"id":9200885,"name":"searchlight","full_name":"nathanl/searchlight","owner":{"login":"nathanl","id":338814,"avatar_url":"https://avatars.githubusercontent.com/u/338814?v=3","gravatar_id":"","url":"https://api.github.com/users/nathanl","html_url":"https://github.com/nathanl","followers_url":"https://api.github.com/users/nathanl/followers","following_url":"https://api.github.com/users/nathanl/following{/other_user}","gists_url":"https://api.github.com/users/nathanl/gists{/gist_id}","starred_url":"https://api.github.com/users/nathanl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nathanl/subscriptions","organizations_url":"https://api.github.com/users/nathanl/orgs","repos_url":"https://api.github.com/users/nathanl/repos","events_url":"https://api.github.com/users/nathanl/events{/privacy}","received_events_url":"https://api.github.com/users/nathanl/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/nathanl/searchlight","description":"Searchlight helps you build searches from options via Ruby methods that you write.","fork":false,"url":"https://api.github.com/repos/nathanl/searchlight","forks_url":"https://api.github.com/repos/nathanl/searchlight/forks","keys_url":"https://api.github.com/repos/nathanl/searchlight/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nathanl/searchlight/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nathanl/searchlight/teams","hooks_url":"https://api.github.com/repos/nathanl/searchlight/hooks","issue_events_url":"https://api.github.com/repos/nathanl/searchlight/issues/events{/number}","events_url":"https://api.github.com/repos/nathanl/searchlight/events","assignees_url":"https://api.github.com/repos/nathanl/searchlight/assignees{/user}","branches_url":"https://api.github.com/repos/nathanl/searchlight/branches{/branch}","tags_url":"https://api.github.com/repos/nathanl/searchlight/tags","blobs_url":"https://api.github.com/repos/nathanl/searchlight/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nathanl/searchlight/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nathanl/searchlight/git/refs{/sha}","trees_url":"https://api.github.com/repos/nathanl/searchlight/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nathanl/searchlight/statuses/{sha}","languages_url":"https://api.github.com/repos/nathanl/searchlight/languages","stargazers_url":"https://api.github.com/repos/nathanl/searchlight/stargazers","contributors_url":"https://api.github.com/repos/nathanl/searchlight/contributors","subscribers_url":"https://api.github.com/repos/nathanl/searchlight/subscribers","subscription_url":"https://api.github.com/repos/nathanl/searchlight/subscription","commits_url":"https://api.github.com/repos/nathanl/searchlight/commits{/sha}","git_commits_url":"https://api.github.com/repos/nathanl/searchlight/git/commits{/sha}","comments_url":"https://api.github.com/repos/nathanl/searchlight/comments{/number}","issue_comment_url":"https://api.github.com/repos/nathanl/searchlight/issues/comments{/number}","contents_url":"https://api.github.com/repos/nathanl/searchlight/contents/{+path}","compare_url":"https://api.github.com/repos/nathanl/searchlight/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nathanl/searchlight/merges","archive_url":"https://api.github.com/repos/nathanl/searchlight/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nathanl/searchlight/downloads","issues_url":"https://api.github.com/repos/nathanl/searchlight/issues{/number}","pulls_url":"https://api.github.com/repos/nathanl/searchlight/pulls{/number}","milestones_url":"https://api.github.com/repos/nathanl/searchlight/milestones{/number}","notifications_url":"https://api.github.com/repos/nathanl/searchlight/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nathanl/searchlight/labels{/name}","releases_url":"https://api.github.com/repos/nathanl/searchlight/releases{/id}","created_at":"2013-04-03T17:43:47Z","updated_at":"2015-04-23T17:59:00Z","pushed_at":"2015-04-23T17:59:00Z","git_url":"git://github.com/nathanl/searchlight.git","ssh_url":"git@github.com:nathanl/searchlight.git","clone_url":"https://github.com/nathanl/searchlight.git","svn_url":"https://github.com/nathanl/searchlight","homepage":"https://github.com/nathanl/searchlight","size":922,"stargazers_count":454,"watchers_count":454,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":14,"mirror_url":null,"open_issues_count":4,"forks":14,"open_issues":4,"watchers":454,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/nathanl/searchlight/pulls/28"},"html":{"href":"https://github.com/nathanl/searchlight/pull/28"},"issue":{"href":"https://api.github.com/repos/nathanl/searchlight/issues/28"},"comments":{"href":"https://api.github.com/repos/nathanl/searchlight/issues/28/comments"},"review_comments":{"href":"https://api.github.com/repos/nathanl/searchlight/pulls/28/comments"},"review_comment":{"href":"https://api.github.com/repos/nathanl/searchlight/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/nathanl/searchlight/pulls/28/commits"},"statuses":{"href":"https://api.github.com/repos/nathanl/searchlight/statuses/79142072382f1496055e0ee0910364345f4438bf"}},"merged":false,"mergeable":false,"mergeable_state":"dirty","merged_by":null,"comments":3,"review_comments":0,"commits":1,"additions":3,"deletions":3,"changed_files":1}}