{"action":"opened","number":915,"pull_request":{"url":"https://api.github.com/repos/activerecord-hackery/ransack/pulls/915","id":185597946,"html_url":"https://github.com/activerecord-hackery/ransack/pull/915","diff_url":"https://github.com/activerecord-hackery/ransack/pull/915.diff","patch_url":"https://github.com/activerecord-hackery/ransack/pull/915.patch","issue_url":"https://api.github.com/repos/activerecord-hackery/ransack/issues/915","number":915,"state":"open","locked":false,"title":"Refactor conditional","user":{"login":"shioyama","id":561827,"avatar_url":"https://avatars3.githubusercontent.com/u/561827?v=4","gravatar_id":"","url":"https://api.github.com/users/shioyama","html_url":"https://github.com/shioyama","followers_url":"https://api.github.com/users/shioyama/followers","following_url":"https://api.github.com/users/shioyama/following{/other_user}","gists_url":"https://api.github.com/users/shioyama/gists{/gist_id}","starred_url":"https://api.github.com/users/shioyama/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shioyama/subscriptions","organizations_url":"https://api.github.com/users/shioyama/orgs","repos_url":"https://api.github.com/users/shioyama/repos","events_url":"https://api.github.com/users/shioyama/events{/privacy}","received_events_url":"https://api.github.com/users/shioyama/received_events","type":"User","site_admin":false},"body":"Just browsing the code I noticed this odd-looking conditional. `detect` returns nil if no result is found, so no need to check it, just return it, right?","created_at":"2018-05-03T01:10:11Z","updated_at":"2018-05-03T01:10:11Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/activerecord-hackery/ransack/pulls/915/commits","review_comments_url":"https://api.github.com/repos/activerecord-hackery/ransack/pulls/915/comments","review_comment_url":"https://api.github.com/repos/activerecord-hackery/ransack/pulls/comments{/number}","comments_url":"https://api.github.com/repos/activerecord-hackery/ransack/issues/915/comments","statuses_url":"https://api.github.com/repos/activerecord-hackery/ransack/statuses/ee5969dc3ff52bdaab1b4fc666e11ad7a16d69c4","head":{"label":"shioyama:refactor_conditional","ref":"refactor_conditional","sha":"ee5969dc3ff52bdaab1b4fc666e11ad7a16d69c4","user":{"login":"shioyama","id":561827,"avatar_url":"https://avatars3.githubusercontent.com/u/561827?v=4","gravatar_id":"","url":"https://api.github.com/users/shioyama","html_url":"https://github.com/shioyama","followers_url":"https://api.github.com/users/shioyama/followers","following_url":"https://api.github.com/users/shioyama/following{/other_user}","gists_url":"https://api.github.com/users/shioyama/gists{/gist_id}","starred_url":"https://api.github.com/users/shioyama/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shioyama/subscriptions","organizations_url":"https://api.github.com/users/shioyama/orgs","repos_url":"https://api.github.com/users/shioyama/repos","events_url":"https://api.github.com/users/shioyama/events{/privacy}","received_events_url":"https://api.github.com/users/shioyama/received_events","type":"User","site_admin":false},"repo":{"id":131923264,"name":"ransack","full_name":"shioyama/ransack","owner":{"login":"shioyama","id":561827,"avatar_url":"https://avatars3.githubusercontent.com/u/561827?v=4","gravatar_id":"","url":"https://api.github.com/users/shioyama","html_url":"https://github.com/shioyama","followers_url":"https://api.github.com/users/shioyama/followers","following_url":"https://api.github.com/users/shioyama/following{/other_user}","gists_url":"https://api.github.com/users/shioyama/gists{/gist_id}","starred_url":"https://api.github.com/users/shioyama/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shioyama/subscriptions","organizations_url":"https://api.github.com/users/shioyama/orgs","repos_url":"https://api.github.com/users/shioyama/repos","events_url":"https://api.github.com/users/shioyama/events{/privacy}","received_events_url":"https://api.github.com/users/shioyama/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/shioyama/ransack","description":"Object-based searching. ","fork":true,"url":"https://api.github.com/repos/shioyama/ransack","forks_url":"https://api.github.com/repos/shioyama/ransack/forks","keys_url":"https://api.github.com/repos/shioyama/ransack/keys{/key_id}","collaborators_url":"https://api.github.com/repos/shioyama/ransack/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/shioyama/ransack/teams","hooks_url":"https://api.github.com/repos/shioyama/ransack/hooks","issue_events_url":"https://api.github.com/repos/shioyama/ransack/issues/events{/number}","events_url":"https://api.github.com/repos/shioyama/ransack/events","assignees_url":"https://api.github.com/repos/shioyama/ransack/assignees{/user}","branches_url":"https://api.github.com/repos/shioyama/ransack/branches{/branch}","tags_url":"https://api.github.com/repos/shioyama/ransack/tags","blobs_url":"https://api.github.com/repos/shioyama/ransack/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/shioyama/ransack/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/shioyama/ransack/git/refs{/sha}","trees_url":"https://api.github.com/repos/shioyama/ransack/git/trees{/sha}","statuses_url":"https://api.github.com/repos/shioyama/ransack/statuses/{sha}","languages_url":"https://api.github.com/repos/shioyama/ransack/languages","stargazers_url":"https://api.github.com/repos/shioyama/ransack/stargazers","contributors_url":"https://api.github.com/repos/shioyama/ransack/contributors","subscribers_url":"https://api.github.com/repos/shioyama/ransack/subscribers","subscription_url":"https://api.github.com/repos/shioyama/ransack/subscription","commits_url":"https://api.github.com/repos/shioyama/ransack/commits{/sha}","git_commits_url":"https://api.github.com/repos/shioyama/ransack/git/commits{/sha}","comments_url":"https://api.github.com/repos/shioyama/ransack/comments{/number}","issue_comment_url":"https://api.github.com/repos/shioyama/ransack/issues/comments{/number}","contents_url":"https://api.github.com/repos/shioyama/ransack/contents/{+path}","compare_url":"https://api.github.com/repos/shioyama/ransack/compare/{base}...{head}","merges_url":"https://api.github.com/repos/shioyama/ransack/merges","archive_url":"https://api.github.com/repos/shioyama/ransack/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/shioyama/ransack/downloads","issues_url":"https://api.github.com/repos/shioyama/ransack/issues{/number}","pulls_url":"https://api.github.com/repos/shioyama/ransack/pulls{/number}","milestones_url":"https://api.github.com/repos/shioyama/ransack/milestones{/number}","notifications_url":"https://api.github.com/repos/shioyama/ransack/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/shioyama/ransack/labels{/name}","releases_url":"https://api.github.com/repos/shioyama/ransack/releases{/id}","deployments_url":"https://api.github.com/repos/shioyama/ransack/deployments","created_at":"2018-05-03T01:08:43Z","updated_at":"2018-05-03T01:08:45Z","pushed_at":"2018-05-03T01:09:14Z","git_url":"git://github.com/shioyama/ransack.git","ssh_url":"git@github.com:shioyama/ransack.git","clone_url":"https://github.com/shioyama/ransack.git","svn_url":"https://github.com/shioyama/ransack","homepage":"http://ransack-demo.herokuapp.com","size":1442,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"activerecord-hackery:master","ref":"master","sha":"581bcd8a788fae3147fab873311fa9c60ae3c41c","user":{"login":"activerecord-hackery","id":5951504,"avatar_url":"https://avatars1.githubusercontent.com/u/5951504?v=4","gravatar_id":"","url":"https://api.github.com/users/activerecord-hackery","html_url":"https://github.com/activerecord-hackery","followers_url":"https://api.github.com/users/activerecord-hackery/followers","following_url":"https://api.github.com/users/activerecord-hackery/following{/other_user}","gists_url":"https://api.github.com/users/activerecord-hackery/gists{/gist_id}","starred_url":"https://api.github.com/users/activerecord-hackery/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/activerecord-hackery/subscriptions","organizations_url":"https://api.github.com/users/activerecord-hackery/orgs","repos_url":"https://api.github.com/users/activerecord-hackery/repos","events_url":"https://api.github.com/users/activerecord-hackery/events{/privacy}","received_events_url":"https://api.github.com/users/activerecord-hackery/received_events","type":"Organization","site_admin":false},"repo":{"id":1548802,"name":"ransack","full_name":"activerecord-hackery/ransack","owner":{"login":"activerecord-hackery","id":5951504,"avatar_url":"https://avatars1.githubusercontent.com/u/5951504?v=4","gravatar_id":"","url":"https://api.github.com/users/activerecord-hackery","html_url":"https://github.com/activerecord-hackery","followers_url":"https://api.github.com/users/activerecord-hackery/followers","following_url":"https://api.github.com/users/activerecord-hackery/following{/other_user}","gists_url":"https://api.github.com/users/activerecord-hackery/gists{/gist_id}","starred_url":"https://api.github.com/users/activerecord-hackery/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/activerecord-hackery/subscriptions","organizations_url":"https://api.github.com/users/activerecord-hackery/orgs","repos_url":"https://api.github.com/users/activerecord-hackery/repos","events_url":"https://api.github.com/users/activerecord-hackery/events{/privacy}","received_events_url":"https://api.github.com/users/activerecord-hackery/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/activerecord-hackery/ransack","description":"Object-based searching. ","fork":false,"url":"https://api.github.com/repos/activerecord-hackery/ransack","forks_url":"https://api.github.com/repos/activerecord-hackery/ransack/forks","keys_url":"https://api.github.com/repos/activerecord-hackery/ransack/keys{/key_id}","collaborators_url":"https://api.github.com/repos/activerecord-hackery/ransack/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/activerecord-hackery/ransack/teams","hooks_url":"https://api.github.com/repos/activerecord-hackery/ransack/hooks","issue_events_url":"https://api.github.com/repos/activerecord-hackery/ransack/issues/events{/number}","events_url":"https://api.github.com/repos/activerecord-hackery/ransack/events","assignees_url":"https://api.github.com/repos/activerecord-hackery/ransack/assignees{/user}","branches_url":"https://api.github.com/repos/activerecord-hackery/ransack/branches{/branch}","tags_url":"https://api.github.com/repos/activerecord-hackery/ransack/tags","blobs_url":"https://api.github.com/repos/activerecord-hackery/ransack/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/activerecord-hackery/ransack/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/activerecord-hackery/ransack/git/refs{/sha}","trees_url":"https://api.github.com/repos/activerecord-hackery/ransack/git/trees{/sha}","statuses_url":"https://api.github.com/repos/activerecord-hackery/ransack/statuses/{sha}","languages_url":"https://api.github.com/repos/activerecord-hackery/ransack/languages","stargazers_url":"https://api.github.com/repos/activerecord-hackery/ransack/stargazers","contributors_url":"https://api.github.com/repos/activerecord-hackery/ransack/contributors","subscribers_url":"https://api.github.com/repos/activerecord-hackery/ransack/subscribers","subscription_url":"https://api.github.com/repos/activerecord-hackery/ransack/subscription","commits_url":"https://api.github.com/repos/activerecord-hackery/ransack/commits{/sha}","git_commits_url":"https://api.github.com/repos/activerecord-hackery/ransack/git/commits{/sha}","comments_url":"https://api.github.com/repos/activerecord-hackery/ransack/comments{/number}","issue_comment_url":"https://api.github.com/repos/activerecord-hackery/ransack/issues/comments{/number}","contents_url":"https://api.github.com/repos/activerecord-hackery/ransack/contents/{+path}","compare_url":"https://api.github.com/repos/activerecord-hackery/ransack/compare/{base}...{head}","merges_url":"https://api.github.com/repos/activerecord-hackery/ransack/merges","archive_url":"https://api.github.com/repos/activerecord-hackery/ransack/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/activerecord-hackery/ransack/downloads","issues_url":"https://api.github.com/repos/activerecord-hackery/ransack/issues{/number}","pulls_url":"https://api.github.com/repos/activerecord-hackery/ransack/pulls{/number}","milestones_url":"https://api.github.com/repos/activerecord-hackery/ransack/milestones{/number}","notifications_url":"https://api.github.com/repos/activerecord-hackery/ransack/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/activerecord-hackery/ransack/labels{/name}","releases_url":"https://api.github.com/repos/activerecord-hackery/ransack/releases{/id}","deployments_url":"https://api.github.com/repos/activerecord-hackery/ransack/deployments","created_at":"2011-03-31T00:34:25Z","updated_at":"2018-05-02T21:07:10Z","pushed_at":"2018-04-16T13:45:10Z","git_url":"git://github.com/activerecord-hackery/ransack.git","ssh_url":"git@github.com:activerecord-hackery/ransack.git","clone_url":"https://github.com/activerecord-hackery/ransack.git","svn_url":"https://github.com/activerecord-hackery/ransack","homepage":"http://ransack-demo.herokuapp.com","size":1442,"stargazers_count":3817,"watchers_count":3817,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":583,"mirror_url":null,"archived":false,"open_issues_count":71,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":583,"open_issues":71,"watchers":3817,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/activerecord-hackery/ransack/pulls/915"},"html":{"href":"https://github.com/activerecord-hackery/ransack/pull/915"},"issue":{"href":"https://api.github.com/repos/activerecord-hackery/ransack/issues/915"},"comments":{"href":"https://api.github.com/repos/activerecord-hackery/ransack/issues/915/comments"},"review_comments":{"href":"https://api.github.com/repos/activerecord-hackery/ransack/pulls/915/comments"},"review_comment":{"href":"https://api.github.com/repos/activerecord-hackery/ransack/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/activerecord-hackery/ransack/pulls/915/commits"},"statuses":{"href":"https://api.github.com/repos/activerecord-hackery/ransack/statuses/ee5969dc3ff52bdaab1b4fc666e11ad7a16d69c4"}},"author_association":"NONE","merged":false,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"maintainer_can_modify":true,"commits":1,"additions":1,"deletions":5,"changed_files":1}}
{"actor":{"display_login":"shioyama"}}