{"action":"created","comment":{"url":"https://api.github.com/repos/malkhafaji/pure_api/pulls/comments/233202021","pull_request_review_id":174561168,"id":233202021,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzMzIwMjAyMQ==","diff_hunk":"@@ -9,34 +9,37 @@ def attributes(*attrs)\n     end\n   end\n \n-  def question_type\n+  def question\n+    return if object.is_deleted\n     if object.q_type == 'Radio'\n-      question_type = 'SingleSelect'\n+      type = 'SingleSelect'\n     elsif object.q_type == 'Check'\n-      question_type = 'MultiSelect'\n+      type = 'MultiSelect'\n     end\n-  end\n-\n-  def question\n-    object.q_text\n+    {\n+      id: object.id,\n+      type: type,\n+      order: object.q_position,\n+      questions: object.q_text\n+    }\n   end\n \n   def answers\n-    if !object.is_deleted\n-      a = []\n-      object.answers.each do |ans|\n-        if !ans.is_deleted\n-          a << {:id => ans.id, :a_text => ans.a_text}\n-        end\n+    return if object.is_deleted","path":"app/serializers/question_serializer.rb","position":40,"original_position":40,"commit_id":"9cf45c2cb10ea972fc105e85f8a3d2bab7c609f3","original_commit_id":"9cf45c2cb10ea972fc105e85f8a3d2bab7c609f3","user":{"login":"ssharba","id":11578245,"node_id":"MDQ6VXNlcjExNTc4MjQ1","avatar_url":"https://avatars0.githubusercontent.com/u/11578245?v=4","gravatar_id":"","url":"https://api.github.com/users/ssharba","html_url":"https://github.com/ssharba","followers_url":"https://api.github.com/users/ssharba/followers","following_url":"https://api.github.com/users/ssharba/following{/other_user}","gists_url":"https://api.github.com/users/ssharba/gists{/gist_id}","starred_url":"https://api.github.com/users/ssharba/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ssharba/subscriptions","organizations_url":"https://api.github.com/users/ssharba/orgs","repos_url":"https://api.github.com/users/ssharba/repos","events_url":"https://api.github.com/users/ssharba/events{/privacy}","received_events_url":"https://api.github.com/users/ssharba/received_events","type":"User","site_admin":false},"body":"this method is Boolean method as it will return true of false, however, it will return nil if the object.is_deleted which bad. fix it please.","created_at":"2018-11-13T20:02:46Z","updated_at":"2018-11-13T20:02:46Z","html_url":"https://github.com/malkhafaji/pure_api/pull/62#discussion_r233202021","pull_request_url":"https://api.github.com/repos/malkhafaji/pure_api/pulls/62","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/malkhafaji/pure_api/pulls/comments/233202021"},"html":{"href":"https://github.com/malkhafaji/pure_api/pull/62#discussion_r233202021"},"pull_request":{"href":"https://api.github.com/repos/malkhafaji/pure_api/pulls/62"}}},"pull_request":{"url":"https://api.github.com/repos/malkhafaji/pure_api/pulls/62","id":230577636,"node_id":"MDExOlB1bGxSZXF1ZXN0MjMwNTc3NjM2","html_url":"https://github.com/malkhafaji/pure_api/pull/62","diff_url":"https://github.com/malkhafaji/pure_api/pull/62.diff","patch_url":"https://github.com/malkhafaji/pure_api/pull/62.patch","issue_url":"https://api.github.com/repos/malkhafaji/pure_api/issues/62","number":62,"state":"open","locked":false,"title":"Fix question serializer","user":{"login":"kandelchy","id":25944202,"node_id":"MDQ6VXNlcjI1OTQ0MjAy","avatar_url":"https://avatars0.githubusercontent.com/u/25944202?v=4","gravatar_id":"","url":"https://api.github.com/users/kandelchy","html_url":"https://github.com/kandelchy","followers_url":"https://api.github.com/users/kandelchy/followers","following_url":"https://api.github.com/users/kandelchy/following{/other_user}","gists_url":"https://api.github.com/users/kandelchy/gists{/gist_id}","starred_url":"https://api.github.com/users/kandelchy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kandelchy/subscriptions","organizations_url":"https://api.github.com/users/kandelchy/orgs","repos_url":"https://api.github.com/users/kandelchy/repos","events_url":"https://api.github.com/users/kandelchy/events{/privacy}","received_events_url":"https://api.github.com/users/kandelchy/received_events","type":"User","site_admin":false},"body":"Make changes to match the required JSON","created_at":"2018-11-13T18:20:04Z","updated_at":"2018-11-13T20:02:46Z","closed_at":null,"merged_at":null,"merge_commit_sha":"645ea3495cd409e41aa78800e71c30e5d2c572e0","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/malkhafaji/pure_api/pulls/62/commits","review_comments_url":"https://api.github.com/repos/malkhafaji/pure_api/pulls/62/comments","review_comment_url":"https://api.github.com/repos/malkhafaji/pure_api/pulls/comments{/number}","comments_url":"https://api.github.com/repos/malkhafaji/pure_api/issues/62/comments","statuses_url":"https://api.github.com/repos/malkhafaji/pure_api/statuses/9cf45c2cb10ea972fc105e85f8a3d2bab7c609f3","head":{"label":"malkhafaji:BK-Add-Question-Type","ref":"BK-Add-Question-Type","sha":"9cf45c2cb10ea972fc105e85f8a3d2bab7c609f3","user":{"login":"malkhafaji","id":6835512,"node_id":"MDQ6VXNlcjY4MzU1MTI=","avatar_url":"https://avatars3.githubusercontent.com/u/6835512?v=4","gravatar_id":"","url":"https://api.github.com/users/malkhafaji","html_url":"https://github.com/malkhafaji","followers_url":"https://api.github.com/users/malkhafaji/followers","following_url":"https://api.github.com/users/malkhafaji/following{/other_user}","gists_url":"https://api.github.com/users/malkhafaji/gists{/gist_id}","starred_url":"https://api.github.com/users/malkhafaji/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/malkhafaji/subscriptions","organizations_url":"https://api.github.com/users/malkhafaji/orgs","repos_url":"https://api.github.com/users/malkhafaji/repos","events_url":"https://api.github.com/users/malkhafaji/events{/privacy}","received_events_url":"https://api.github.com/users/malkhafaji/received_events","type":"User","site_admin":false},"repo":{"id":153382399,"node_id":"MDEwOlJlcG9zaXRvcnkxNTMzODIzOTk=","name":"pure_api","full_name":"malkhafaji/pure_api","private":false,"owner":{"login":"malkhafaji","id":6835512,"node_id":"MDQ6VXNlcjY4MzU1MTI=","avatar_url":"https://avatars3.githubusercontent.com/u/6835512?v=4","gravatar_id":"","url":"https://api.github.com/users/malkhafaji","html_url":"https://github.com/malkhafaji","followers_url":"https://api.github.com/users/malkhafaji/followers","following_url":"https://api.github.com/users/malkhafaji/following{/other_user}","gists_url":"https://api.github.com/users/malkhafaji/gists{/gist_id}","starred_url":"https://api.github.com/users/malkhafaji/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/malkhafaji/subscriptions","organizations_url":"https://api.github.com/users/malkhafaji/orgs","repos_url":"https://api.github.com/users/malkhafaji/repos","events_url":"https://api.github.com/users/malkhafaji/events{/privacy}","received_events_url":"https://api.github.com/users/malkhafaji/received_events","type":"User","site_admin":false},"html_url":"https://github.com/malkhafaji/pure_api","description":null,"fork":false,"url":"https://api.github.com/repos/malkhafaji/pure_api","forks_url":"https://api.github.com/repos/malkhafaji/pure_api/forks","keys_url":"https://api.github.com/repos/malkhafaji/pure_api/keys{/key_id}","collaborators_url":"https://api.github.com/repos/malkhafaji/pure_api/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/malkhafaji/pure_api/teams","hooks_url":"https://api.github.com/repos/malkhafaji/pure_api/hooks","issue_events_url":"https://api.github.com/repos/malkhafaji/pure_api/issues/events{/number}","events_url":"https://api.github.com/repos/malkhafaji/pure_api/events","assignees_url":"https://api.github.com/repos/malkhafaji/pure_api/assignees{/user}","branches_url":"https://api.github.com/repos/malkhafaji/pure_api/branches{/branch}","tags_url":"https://api.github.com/repos/malkhafaji/pure_api/tags","blobs_url":"https://api.github.com/repos/malkhafaji/pure_api/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/malkhafaji/pure_api/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/malkhafaji/pure_api/git/refs{/sha}","trees_url":"https://api.github.com/repos/malkhafaji/pure_api/git/trees{/sha}","statuses_url":"https://api.github.com/repos/malkhafaji/pure_api/statuses/{sha}","languages_url":"https://api.github.com/repos/malkhafaji/pure_api/languages","stargazers_url":"https://api.github.com/repos/malkhafaji/pure_api/stargazers","contributors_url":"https://api.github.com/repos/malkhafaji/pure_api/contributors","subscribers_url":"https://api.github.com/repos/malkhafaji/pure_api/subscribers","subscription_url":"https://api.github.com/repos/malkhafaji/pure_api/subscription","commits_url":"https://api.github.com/repos/malkhafaji/pure_api/commits{/sha}","git_commits_url":"https://api.github.com/repos/malkhafaji/pure_api/git/commits{/sha}","comments_url":"https://api.github.com/repos/malkhafaji/pure_api/comments{/number}","issue_comment_url":"https://api.github.com/repos/malkhafaji/pure_api/issues/comments{/number}","contents_url":"https://api.github.com/repos/malkhafaji/pure_api/contents/{+path}","compare_url":"https://api.github.com/repos/malkhafaji/pure_api/compare/{base}...{head}","merges_url":"https://api.github.com/repos/malkhafaji/pure_api/merges","archive_url":"https://api.github.com/repos/malkhafaji/pure_api/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/malkhafaji/pure_api/downloads","issues_url":"https://api.github.com/repos/malkhafaji/pure_api/issues{/number}","pulls_url":"https://api.github.com/repos/malkhafaji/pure_api/pulls{/number}","milestones_url":"https://api.github.com/repos/malkhafaji/pure_api/milestones{/number}","notifications_url":"https://api.github.com/repos/malkhafaji/pure_api/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/malkhafaji/pure_api/labels{/name}","releases_url":"https://api.github.com/repos/malkhafaji/pure_api/releases{/id}","deployments_url":"https://api.github.com/repos/malkhafaji/pure_api/deployments","created_at":"2018-10-17T02:16:11Z","updated_at":"2018-11-13T18:30:47Z","pushed_at":"2018-11-13T19:58:27Z","git_url":"git://github.com/malkhafaji/pure_api.git","ssh_url":"git@github.com:malkhafaji/pure_api.git","clone_url":"https://github.com/malkhafaji/pure_api.git","svn_url":"https://github.com/malkhafaji/pure_api","homepage":null,"size":287,"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":7,"license":null,"forks":0,"open_issues":7,"watchers":0,"default_branch":"dev"}},"base":{"label":"malkhafaji:dev","ref":"dev","sha":"f3ac926b503eca5f38c6c4d810493d4cdff2fe54","user":{"login":"malkhafaji","id":6835512,"node_id":"MDQ6VXNlcjY4MzU1MTI=","avatar_url":"https://avatars3.githubusercontent.com/u/6835512?v=4","gravatar_id":"","url":"https://api.github.com/users/malkhafaji","html_url":"https://github.com/malkhafaji","followers_url":"https://api.github.com/users/malkhafaji/followers","following_url":"https://api.github.com/users/malkhafaji/following{/other_user}","gists_url":"https://api.github.com/users/malkhafaji/gists{/gist_id}","starred_url":"https://api.github.com/users/malkhafaji/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/malkhafaji/subscriptions","organizations_url":"https://api.github.com/users/malkhafaji/orgs","repos_url":"https://api.github.com/users/malkhafaji/repos","events_url":"https://api.github.com/users/malkhafaji/events{/privacy}","received_events_url":"https://api.github.com/users/malkhafaji/received_events","type":"User","site_admin":false},"repo":{"id":153382399,"node_id":"MDEwOlJlcG9zaXRvcnkxNTMzODIzOTk=","name":"pure_api","full_name":"malkhafaji/pure_api","private":false,"owner":{"login":"malkhafaji","id":6835512,"node_id":"MDQ6VXNlcjY4MzU1MTI=","avatar_url":"https://avatars3.githubusercontent.com/u/6835512?v=4","gravatar_id":"","url":"https://api.github.com/users/malkhafaji","html_url":"https://github.com/malkhafaji","followers_url":"https://api.github.com/users/malkhafaji/followers","following_url":"https://api.github.com/users/malkhafaji/following{/other_user}","gists_url":"https://api.github.com/users/malkhafaji/gists{/gist_id}","starred_url":"https://api.github.com/users/malkhafaji/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/malkhafaji/subscriptions","organizations_url":"https://api.github.com/users/malkhafaji/orgs","repos_url":"https://api.github.com/users/malkhafaji/repos","events_url":"https://api.github.com/users/malkhafaji/events{/privacy}","received_events_url":"https://api.github.com/users/malkhafaji/received_events","type":"User","site_admin":false},"html_url":"https://github.com/malkhafaji/pure_api","description":null,"fork":false,"url":"https://api.github.com/repos/malkhafaji/pure_api","forks_url":"https://api.github.com/repos/malkhafaji/pure_api/forks","keys_url":"https://api.github.com/repos/malkhafaji/pure_api/keys{/key_id}","collaborators_url":"https://api.github.com/repos/malkhafaji/pure_api/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/malkhafaji/pure_api/teams","hooks_url":"https://api.github.com/repos/malkhafaji/pure_api/hooks","issue_events_url":"https://api.github.com/repos/malkhafaji/pure_api/issues/events{/number}","events_url":"https://api.github.com/repos/malkhafaji/pure_api/events","assignees_url":"https://api.github.com/repos/malkhafaji/pure_api/assignees{/user}","branches_url":"https://api.github.com/repos/malkhafaji/pure_api/branches{/branch}","tags_url":"https://api.github.com/repos/malkhafaji/pure_api/tags","blobs_url":"https://api.github.com/repos/malkhafaji/pure_api/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/malkhafaji/pure_api/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/malkhafaji/pure_api/git/refs{/sha}","trees_url":"https://api.github.com/repos/malkhafaji/pure_api/git/trees{/sha}","statuses_url":"https://api.github.com/repos/malkhafaji/pure_api/statuses/{sha}","languages_url":"https://api.github.com/repos/malkhafaji/pure_api/languages","stargazers_url":"https://api.github.com/repos/malkhafaji/pure_api/stargazers","contributors_url":"https://api.github.com/repos/malkhafaji/pure_api/contributors","subscribers_url":"https://api.github.com/repos/malkhafaji/pure_api/subscribers","subscription_url":"https://api.github.com/repos/malkhafaji/pure_api/subscription","commits_url":"https://api.github.com/repos/malkhafaji/pure_api/commits{/sha}","git_commits_url":"https://api.github.com/repos/malkhafaji/pure_api/git/commits{/sha}","comments_url":"https://api.github.com/repos/malkhafaji/pure_api/comments{/number}","issue_comment_url":"https://api.github.com/repos/malkhafaji/pure_api/issues/comments{/number}","contents_url":"https://api.github.com/repos/malkhafaji/pure_api/contents/{+path}","compare_url":"https://api.github.com/repos/malkhafaji/pure_api/compare/{base}...{head}","merges_url":"https://api.github.com/repos/malkhafaji/pure_api/merges","archive_url":"https://api.github.com/repos/malkhafaji/pure_api/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/malkhafaji/pure_api/downloads","issues_url":"https://api.github.com/repos/malkhafaji/pure_api/issues{/number}","pulls_url":"https://api.github.com/repos/malkhafaji/pure_api/pulls{/number}","milestones_url":"https://api.github.com/repos/malkhafaji/pure_api/milestones{/number}","notifications_url":"https://api.github.com/repos/malkhafaji/pure_api/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/malkhafaji/pure_api/labels{/name}","releases_url":"https://api.github.com/repos/malkhafaji/pure_api/releases{/id}","deployments_url":"https://api.github.com/repos/malkhafaji/pure_api/deployments","created_at":"2018-10-17T02:16:11Z","updated_at":"2018-11-13T18:30:47Z","pushed_at":"2018-11-13T19:58:27Z","git_url":"git://github.com/malkhafaji/pure_api.git","ssh_url":"git@github.com:malkhafaji/pure_api.git","clone_url":"https://github.com/malkhafaji/pure_api.git","svn_url":"https://github.com/malkhafaji/pure_api","homepage":null,"size":287,"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":7,"license":null,"forks":0,"open_issues":7,"watchers":0,"default_branch":"dev"}},"_links":{"self":{"href":"https://api.github.com/repos/malkhafaji/pure_api/pulls/62"},"html":{"href":"https://github.com/malkhafaji/pure_api/pull/62"},"issue":{"href":"https://api.github.com/repos/malkhafaji/pure_api/issues/62"},"comments":{"href":"https://api.github.com/repos/malkhafaji/pure_api/issues/62/comments"},"review_comments":{"href":"https://api.github.com/repos/malkhafaji/pure_api/pulls/62/comments"},"review_comment":{"href":"https://api.github.com/repos/malkhafaji/pure_api/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/malkhafaji/pure_api/pulls/62/commits"},"statuses":{"href":"https://api.github.com/repos/malkhafaji/pure_api/statuses/9cf45c2cb10ea972fc105e85f8a3d2bab7c609f3"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"ssharba"}}