{"action":"created","comment":{"url":"https://api.github.com/repos/Lynns0416/task-tracker/pulls/comments/241667742","pull_request_review_id":184997911,"id":241667742,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI0MTY2Nzc0Mg==","diff_hunk":"@@ -10,10 +10,9 @@ def format_date\n   end\n \n   def self.search(title, status)\n-    # HACK: 臭います。どうにかしたいが一旦このままでいきます\n-    if (title && !title.empty?) && (status && !status.empty?)\n+    if !title.blank? && !status.blank?\n       where('title LIKE ?', \"%#{title}%\").where(status: status)\n-    elsif (title && !title.empty?) && (!status || status.empty?)\n+    elsif !title.blank? && status.blank?","path":"app/models/task.rb","position":9,"original_position":9,"commit_id":"ee398e651ee72ab644c03a9d7ea879d923acb6f8","original_commit_id":"ee398e651ee72ab644c03a9d7ea879d923acb6f8","user":{"login":"iwasaki-d","id":11012221,"node_id":"MDQ6VXNlcjExMDEyMjIx","avatar_url":"https://avatars3.githubusercontent.com/u/11012221?v=4","gravatar_id":"","url":"https://api.github.com/users/iwasaki-d","html_url":"https://github.com/iwasaki-d","followers_url":"https://api.github.com/users/iwasaki-d/followers","following_url":"https://api.github.com/users/iwasaki-d/following{/other_user}","gists_url":"https://api.github.com/users/iwasaki-d/gists{/gist_id}","starred_url":"https://api.github.com/users/iwasaki-d/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iwasaki-d/subscriptions","organizations_url":"https://api.github.com/users/iwasaki-d/orgs","repos_url":"https://api.github.com/users/iwasaki-d/repos","events_url":"https://api.github.com/users/iwasaki-d/events{/privacy}","received_events_url":"https://api.github.com/users/iwasaki-d/received_events","type":"User","site_admin":false},"body":"@Lynns0416  @yiworks \r\n\r\n変更前より良くなっていますが、否定の否定を組み合わせて書くのは、まだちょっとわかりにくさがありますね。\r\n条件文が１つであれば!を使っても読めますが、組み合わされると途端に難しくなってしまいます。\r\nできる限り否定は使わないで書いた方が、バグも出にくいですよ。\r\n\r\n`\r\nif title.present? \r\n  if status.present?\r\n     where('title LIKE ?', \"%#{title}%\").where(status: status)\r\n  else\r\n     where('title LIKE ?', \"%#{title}%\")\r\n  end\r\nelse\r\n  where(status: status)\r\nend\r\n`\r\n\r\n行数は増えたけど、こっちの方がわかりやすい！\r\n","created_at":"2018-12-14T07:55:44Z","updated_at":"2018-12-14T07:55:44Z","html_url":"https://github.com/Lynns0416/task-tracker/pull/14#discussion_r241667742","pull_request_url":"https://api.github.com/repos/Lynns0416/task-tracker/pulls/14","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/Lynns0416/task-tracker/pulls/comments/241667742"},"html":{"href":"https://github.com/Lynns0416/task-tracker/pull/14#discussion_r241667742"},"pull_request":{"href":"https://api.github.com/repos/Lynns0416/task-tracker/pulls/14"}}},"pull_request":{"url":"https://api.github.com/repos/Lynns0416/task-tracker/pulls/14","id":238626676,"node_id":"MDExOlB1bGxSZXF1ZXN0MjM4NjI2Njc2","html_url":"https://github.com/Lynns0416/task-tracker/pull/14","diff_url":"https://github.com/Lynns0416/task-tracker/pull/14.diff","patch_url":"https://github.com/Lynns0416/task-tracker/pull/14.patch","issue_url":"https://api.github.com/repos/Lynns0416/task-tracker/issues/14","number":14,"state":"open","locked":false,"title":"[fixed #162655947] 【リファクタリング】HACK や TODO を片付ける","user":{"login":"Lynns0416","id":13435384,"node_id":"MDQ6VXNlcjEzNDM1Mzg0","avatar_url":"https://avatars1.githubusercontent.com/u/13435384?v=4","gravatar_id":"","url":"https://api.github.com/users/Lynns0416","html_url":"https://github.com/Lynns0416","followers_url":"https://api.github.com/users/Lynns0416/followers","following_url":"https://api.github.com/users/Lynns0416/following{/other_user}","gists_url":"https://api.github.com/users/Lynns0416/gists{/gist_id}","starred_url":"https://api.github.com/users/Lynns0416/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Lynns0416/subscriptions","organizations_url":"https://api.github.com/users/Lynns0416/orgs","repos_url":"https://api.github.com/users/Lynns0416/repos","events_url":"https://api.github.com/users/Lynns0416/events{/privacy}","received_events_url":"https://api.github.com/users/Lynns0416/received_events","type":"User","site_admin":false},"body":"https://www.pivotaltracker.com/story/show/162655947\r\n\r\n勝手にステップを増やしたことでレビュー量を増やしてしまい、申し訳ありません。。\r\n（ただのコメント修正になってしまった箇所もあります。。。）\r\n\r\n【懸念点】\r\n**app/helpers/tasks_helper.rb**\r\n\r\n → `Object#send` を使用した箇所がありますが、[安易に使うと脆弱性となる場合がある](https://qiita.com/igrep/items/b2fed2d467f8a16f5eb0) との記事を見ました。今回の場合は問題ないと判断しましたが、基本的に使用を控えるべきでしょうか。\r\n\r\nよろしくお願いします！","created_at":"2018-12-14T06:53:19Z","updated_at":"2018-12-14T07:55:44Z","closed_at":null,"merged_at":null,"merge_commit_sha":"27918771d5922445d0090465a3a1696e20bb7196","assignee":{"login":"iwasaki-d","id":11012221,"node_id":"MDQ6VXNlcjExMDEyMjIx","avatar_url":"https://avatars3.githubusercontent.com/u/11012221?v=4","gravatar_id":"","url":"https://api.github.com/users/iwasaki-d","html_url":"https://github.com/iwasaki-d","followers_url":"https://api.github.com/users/iwasaki-d/followers","following_url":"https://api.github.com/users/iwasaki-d/following{/other_user}","gists_url":"https://api.github.com/users/iwasaki-d/gists{/gist_id}","starred_url":"https://api.github.com/users/iwasaki-d/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iwasaki-d/subscriptions","organizations_url":"https://api.github.com/users/iwasaki-d/orgs","repos_url":"https://api.github.com/users/iwasaki-d/repos","events_url":"https://api.github.com/users/iwasaki-d/events{/privacy}","received_events_url":"https://api.github.com/users/iwasaki-d/received_events","type":"User","site_admin":false},"assignees":[{"login":"iwasaki-d","id":11012221,"node_id":"MDQ6VXNlcjExMDEyMjIx","avatar_url":"https://avatars3.githubusercontent.com/u/11012221?v=4","gravatar_id":"","url":"https://api.github.com/users/iwasaki-d","html_url":"https://github.com/iwasaki-d","followers_url":"https://api.github.com/users/iwasaki-d/followers","following_url":"https://api.github.com/users/iwasaki-d/following{/other_user}","gists_url":"https://api.github.com/users/iwasaki-d/gists{/gist_id}","starred_url":"https://api.github.com/users/iwasaki-d/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iwasaki-d/subscriptions","organizations_url":"https://api.github.com/users/iwasaki-d/orgs","repos_url":"https://api.github.com/users/iwasaki-d/repos","events_url":"https://api.github.com/users/iwasaki-d/events{/privacy}","received_events_url":"https://api.github.com/users/iwasaki-d/received_events","type":"User","site_admin":false},{"login":"yiworks","id":37338201,"node_id":"MDQ6VXNlcjM3MzM4MjAx","avatar_url":"https://avatars1.githubusercontent.com/u/37338201?v=4","gravatar_id":"","url":"https://api.github.com/users/yiworks","html_url":"https://github.com/yiworks","followers_url":"https://api.github.com/users/yiworks/followers","following_url":"https://api.github.com/users/yiworks/following{/other_user}","gists_url":"https://api.github.com/users/yiworks/gists{/gist_id}","starred_url":"https://api.github.com/users/yiworks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yiworks/subscriptions","organizations_url":"https://api.github.com/users/yiworks/orgs","repos_url":"https://api.github.com/users/yiworks/repos","events_url":"https://api.github.com/users/yiworks/events{/privacy}","received_events_url":"https://api.github.com/users/yiworks/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/Lynns0416/task-tracker/pulls/14/commits","review_comments_url":"https://api.github.com/repos/Lynns0416/task-tracker/pulls/14/comments","review_comment_url":"https://api.github.com/repos/Lynns0416/task-tracker/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Lynns0416/task-tracker/issues/14/comments","statuses_url":"https://api.github.com/repos/Lynns0416/task-tracker/statuses/ee398e651ee72ab644c03a9d7ea879d923acb6f8","head":{"label":"Lynns0416:refactoring-1","ref":"refactoring-1","sha":"ee398e651ee72ab644c03a9d7ea879d923acb6f8","user":{"login":"Lynns0416","id":13435384,"node_id":"MDQ6VXNlcjEzNDM1Mzg0","avatar_url":"https://avatars1.githubusercontent.com/u/13435384?v=4","gravatar_id":"","url":"https://api.github.com/users/Lynns0416","html_url":"https://github.com/Lynns0416","followers_url":"https://api.github.com/users/Lynns0416/followers","following_url":"https://api.github.com/users/Lynns0416/following{/other_user}","gists_url":"https://api.github.com/users/Lynns0416/gists{/gist_id}","starred_url":"https://api.github.com/users/Lynns0416/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Lynns0416/subscriptions","organizations_url":"https://api.github.com/users/Lynns0416/orgs","repos_url":"https://api.github.com/users/Lynns0416/repos","events_url":"https://api.github.com/users/Lynns0416/events{/privacy}","received_events_url":"https://api.github.com/users/Lynns0416/received_events","type":"User","site_admin":false},"repo":{"id":161132803,"node_id":"MDEwOlJlcG9zaXRvcnkxNjExMzI4MDM=","name":"task-tracker","full_name":"Lynns0416/task-tracker","private":false,"owner":{"login":"Lynns0416","id":13435384,"node_id":"MDQ6VXNlcjEzNDM1Mzg0","avatar_url":"https://avatars1.githubusercontent.com/u/13435384?v=4","gravatar_id":"","url":"https://api.github.com/users/Lynns0416","html_url":"https://github.com/Lynns0416","followers_url":"https://api.github.com/users/Lynns0416/followers","following_url":"https://api.github.com/users/Lynns0416/following{/other_user}","gists_url":"https://api.github.com/users/Lynns0416/gists{/gist_id}","starred_url":"https://api.github.com/users/Lynns0416/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Lynns0416/subscriptions","organizations_url":"https://api.github.com/users/Lynns0416/orgs","repos_url":"https://api.github.com/users/Lynns0416/repos","events_url":"https://api.github.com/users/Lynns0416/events{/privacy}","received_events_url":"https://api.github.com/users/Lynns0416/received_events","type":"User","site_admin":false},"html_url":"https://github.com/Lynns0416/task-tracker","description":null,"fork":false,"url":"https://api.github.com/repos/Lynns0416/task-tracker","forks_url":"https://api.github.com/repos/Lynns0416/task-tracker/forks","keys_url":"https://api.github.com/repos/Lynns0416/task-tracker/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Lynns0416/task-tracker/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Lynns0416/task-tracker/teams","hooks_url":"https://api.github.com/repos/Lynns0416/task-tracker/hooks","issue_events_url":"https://api.github.com/repos/Lynns0416/task-tracker/issues/events{/number}","events_url":"https://api.github.com/repos/Lynns0416/task-tracker/events","assignees_url":"https://api.github.com/repos/Lynns0416/task-tracker/assignees{/user}","branches_url":"https://api.github.com/repos/Lynns0416/task-tracker/branches{/branch}","tags_url":"https://api.github.com/repos/Lynns0416/task-tracker/tags","blobs_url":"https://api.github.com/repos/Lynns0416/task-tracker/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Lynns0416/task-tracker/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Lynns0416/task-tracker/git/refs{/sha}","trees_url":"https://api.github.com/repos/Lynns0416/task-tracker/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Lynns0416/task-tracker/statuses/{sha}","languages_url":"https://api.github.com/repos/Lynns0416/task-tracker/languages","stargazers_url":"https://api.github.com/repos/Lynns0416/task-tracker/stargazers","contributors_url":"https://api.github.com/repos/Lynns0416/task-tracker/contributors","subscribers_url":"https://api.github.com/repos/Lynns0416/task-tracker/subscribers","subscription_url":"https://api.github.com/repos/Lynns0416/task-tracker/subscription","commits_url":"https://api.github.com/repos/Lynns0416/task-tracker/commits{/sha}","git_commits_url":"https://api.github.com/repos/Lynns0416/task-tracker/git/commits{/sha}","comments_url":"https://api.github.com/repos/Lynns0416/task-tracker/comments{/number}","issue_comment_url":"https://api.github.com/repos/Lynns0416/task-tracker/issues/comments{/number}","contents_url":"https://api.github.com/repos/Lynns0416/task-tracker/contents/{+path}","compare_url":"https://api.github.com/repos/Lynns0416/task-tracker/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Lynns0416/task-tracker/merges","archive_url":"https://api.github.com/repos/Lynns0416/task-tracker/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Lynns0416/task-tracker/downloads","issues_url":"https://api.github.com/repos/Lynns0416/task-tracker/issues{/number}","pulls_url":"https://api.github.com/repos/Lynns0416/task-tracker/pulls{/number}","milestones_url":"https://api.github.com/repos/Lynns0416/task-tracker/milestones{/number}","notifications_url":"https://api.github.com/repos/Lynns0416/task-tracker/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Lynns0416/task-tracker/labels{/name}","releases_url":"https://api.github.com/repos/Lynns0416/task-tracker/releases{/id}","deployments_url":"https://api.github.com/repos/Lynns0416/task-tracker/deployments","created_at":"2018-12-10T07:12:19Z","updated_at":"2018-12-14T03:23:45Z","pushed_at":"2018-12-14T06:53:20Z","git_url":"git://github.com/Lynns0416/task-tracker.git","ssh_url":"git@github.com:Lynns0416/task-tracker.git","clone_url":"https://github.com/Lynns0416/task-tracker.git","svn_url":"https://github.com/Lynns0416/task-tracker","homepage":null,"size":227,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":4,"license":null,"forks":0,"open_issues":4,"watchers":0,"default_branch":"master"}},"base":{"label":"Lynns0416:17-add-pagination","ref":"17-add-pagination","sha":"b1095691a582c022a0313c5860db13302e5a07f5","user":{"login":"Lynns0416","id":13435384,"node_id":"MDQ6VXNlcjEzNDM1Mzg0","avatar_url":"https://avatars1.githubusercontent.com/u/13435384?v=4","gravatar_id":"","url":"https://api.github.com/users/Lynns0416","html_url":"https://github.com/Lynns0416","followers_url":"https://api.github.com/users/Lynns0416/followers","following_url":"https://api.github.com/users/Lynns0416/following{/other_user}","gists_url":"https://api.github.com/users/Lynns0416/gists{/gist_id}","starred_url":"https://api.github.com/users/Lynns0416/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Lynns0416/subscriptions","organizations_url":"https://api.github.com/users/Lynns0416/orgs","repos_url":"https://api.github.com/users/Lynns0416/repos","events_url":"https://api.github.com/users/Lynns0416/events{/privacy}","received_events_url":"https://api.github.com/users/Lynns0416/received_events","type":"User","site_admin":false},"repo":{"id":161132803,"node_id":"MDEwOlJlcG9zaXRvcnkxNjExMzI4MDM=","name":"task-tracker","full_name":"Lynns0416/task-tracker","private":false,"owner":{"login":"Lynns0416","id":13435384,"node_id":"MDQ6VXNlcjEzNDM1Mzg0","avatar_url":"https://avatars1.githubusercontent.com/u/13435384?v=4","gravatar_id":"","url":"https://api.github.com/users/Lynns0416","html_url":"https://github.com/Lynns0416","followers_url":"https://api.github.com/users/Lynns0416/followers","following_url":"https://api.github.com/users/Lynns0416/following{/other_user}","gists_url":"https://api.github.com/users/Lynns0416/gists{/gist_id}","starred_url":"https://api.github.com/users/Lynns0416/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Lynns0416/subscriptions","organizations_url":"https://api.github.com/users/Lynns0416/orgs","repos_url":"https://api.github.com/users/Lynns0416/repos","events_url":"https://api.github.com/users/Lynns0416/events{/privacy}","received_events_url":"https://api.github.com/users/Lynns0416/received_events","type":"User","site_admin":false},"html_url":"https://github.com/Lynns0416/task-tracker","description":null,"fork":false,"url":"https://api.github.com/repos/Lynns0416/task-tracker","forks_url":"https://api.github.com/repos/Lynns0416/task-tracker/forks","keys_url":"https://api.github.com/repos/Lynns0416/task-tracker/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Lynns0416/task-tracker/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Lynns0416/task-tracker/teams","hooks_url":"https://api.github.com/repos/Lynns0416/task-tracker/hooks","issue_events_url":"https://api.github.com/repos/Lynns0416/task-tracker/issues/events{/number}","events_url":"https://api.github.com/repos/Lynns0416/task-tracker/events","assignees_url":"https://api.github.com/repos/Lynns0416/task-tracker/assignees{/user}","branches_url":"https://api.github.com/repos/Lynns0416/task-tracker/branches{/branch}","tags_url":"https://api.github.com/repos/Lynns0416/task-tracker/tags","blobs_url":"https://api.github.com/repos/Lynns0416/task-tracker/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Lynns0416/task-tracker/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Lynns0416/task-tracker/git/refs{/sha}","trees_url":"https://api.github.com/repos/Lynns0416/task-tracker/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Lynns0416/task-tracker/statuses/{sha}","languages_url":"https://api.github.com/repos/Lynns0416/task-tracker/languages","stargazers_url":"https://api.github.com/repos/Lynns0416/task-tracker/stargazers","contributors_url":"https://api.github.com/repos/Lynns0416/task-tracker/contributors","subscribers_url":"https://api.github.com/repos/Lynns0416/task-tracker/subscribers","subscription_url":"https://api.github.com/repos/Lynns0416/task-tracker/subscription","commits_url":"https://api.github.com/repos/Lynns0416/task-tracker/commits{/sha}","git_commits_url":"https://api.github.com/repos/Lynns0416/task-tracker/git/commits{/sha}","comments_url":"https://api.github.com/repos/Lynns0416/task-tracker/comments{/number}","issue_comment_url":"https://api.github.com/repos/Lynns0416/task-tracker/issues/comments{/number}","contents_url":"https://api.github.com/repos/Lynns0416/task-tracker/contents/{+path}","compare_url":"https://api.github.com/repos/Lynns0416/task-tracker/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Lynns0416/task-tracker/merges","archive_url":"https://api.github.com/repos/Lynns0416/task-tracker/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Lynns0416/task-tracker/downloads","issues_url":"https://api.github.com/repos/Lynns0416/task-tracker/issues{/number}","pulls_url":"https://api.github.com/repos/Lynns0416/task-tracker/pulls{/number}","milestones_url":"https://api.github.com/repos/Lynns0416/task-tracker/milestones{/number}","notifications_url":"https://api.github.com/repos/Lynns0416/task-tracker/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Lynns0416/task-tracker/labels{/name}","releases_url":"https://api.github.com/repos/Lynns0416/task-tracker/releases{/id}","deployments_url":"https://api.github.com/repos/Lynns0416/task-tracker/deployments","created_at":"2018-12-10T07:12:19Z","updated_at":"2018-12-14T03:23:45Z","pushed_at":"2018-12-14T06:53:20Z","git_url":"git://github.com/Lynns0416/task-tracker.git","ssh_url":"git@github.com:Lynns0416/task-tracker.git","clone_url":"https://github.com/Lynns0416/task-tracker.git","svn_url":"https://github.com/Lynns0416/task-tracker","homepage":null,"size":227,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":4,"license":null,"forks":0,"open_issues":4,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Lynns0416/task-tracker/pulls/14"},"html":{"href":"https://github.com/Lynns0416/task-tracker/pull/14"},"issue":{"href":"https://api.github.com/repos/Lynns0416/task-tracker/issues/14"},"comments":{"href":"https://api.github.com/repos/Lynns0416/task-tracker/issues/14/comments"},"review_comments":{"href":"https://api.github.com/repos/Lynns0416/task-tracker/pulls/14/comments"},"review_comment":{"href":"https://api.github.com/repos/Lynns0416/task-tracker/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Lynns0416/task-tracker/pulls/14/commits"},"statuses":{"href":"https://api.github.com/repos/Lynns0416/task-tracker/statuses/ee398e651ee72ab644c03a9d7ea879d923acb6f8"}},"author_association":"OWNER"}}
{"actor":{"display_login":"iwasaki-d"}}