{"action":"created","comment":{"url":"https://api.github.com/repos/SumOfUs/Champaign/pulls/comments/86399137","pull_request_review_id":7058181,"id":86399137,"diff_hunk":"@@ -23,15 +23,25 @@ def element\n   end\n \n   def params\n-    if @params[:choices].respond_to?(:map)\n-      @params[:choices].map! do |choice|\n-        begin\n-          JSON.parse(choice)\n-        rescue JSON::ParserError\n-          choice\n-        end\n+    @params[:choices] = format_many_choices if @params[:many_choices].present?\n+    @params[:choices] = format_choices","path":"app/services/form_element_builder.rb","position":21,"original_position":21,"commit_id":"18353daaee4f2c857e4301eb827554a8ef4387dd","original_commit_id":"18353daaee4f2c857e4301eb827554a8ef4387dd","user":{"login":"osahyoun","id":12949,"avatar_url":"https://avatars.githubusercontent.com/u/12949?v=3","gravatar_id":"","url":"https://api.github.com/users/osahyoun","html_url":"https://github.com/osahyoun","followers_url":"https://api.github.com/users/osahyoun/followers","following_url":"https://api.github.com/users/osahyoun/following{/other_user}","gists_url":"https://api.github.com/users/osahyoun/gists{/gist_id}","starred_url":"https://api.github.com/users/osahyoun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/osahyoun/subscriptions","organizations_url":"https://api.github.com/users/osahyoun/orgs","repos_url":"https://api.github.com/users/osahyoun/repos","events_url":"https://api.github.com/users/osahyoun/events{/privacy}","received_events_url":"https://api.github.com/users/osahyoun/received_events","type":"User","site_admin":false},"body":"because of the assignment I'd rather you passed `params[:choices]` to `format_many_choices` and `format_choices`. I think it makes the code easier to reason with.","created_at":"2016-11-03T17:29:04Z","updated_at":"2016-11-03T17:32:10Z","html_url":"https://github.com/SumOfUs/Champaign/pull/741#discussion_r86399137","pull_request_url":"https://api.github.com/repos/SumOfUs/Champaign/pulls/741","_links":{"self":{"href":"https://api.github.com/repos/SumOfUs/Champaign/pulls/comments/86399137"},"html":{"href":"https://github.com/SumOfUs/Champaign/pull/741#discussion_r86399137"},"pull_request":{"href":"https://api.github.com/repos/SumOfUs/Champaign/pulls/741"}}},"pull_request":{"url":"https://api.github.com/repos/SumOfUs/Champaign/pulls/741","id":91726022,"html_url":"https://github.com/SumOfUs/Champaign/pull/741","diff_url":"https://github.com/SumOfUs/Champaign/pull/741.diff","patch_url":"https://github.com/SumOfUs/Champaign/pull/741.patch","issue_url":"https://api.github.com/repos/SumOfUs/Champaign/issues/741","number":741,"state":"open","locked":false,"title":"Add dropdown element to surveys","user":{"login":"NealJMD","id":102218,"avatar_url":"https://avatars.githubusercontent.com/u/102218?v=3","gravatar_id":"","url":"https://api.github.com/users/NealJMD","html_url":"https://github.com/NealJMD","followers_url":"https://api.github.com/users/NealJMD/followers","following_url":"https://api.github.com/users/NealJMD/following{/other_user}","gists_url":"https://api.github.com/users/NealJMD/gists{/gist_id}","starred_url":"https://api.github.com/users/NealJMD/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NealJMD/subscriptions","organizations_url":"https://api.github.com/users/NealJMD/orgs","repos_url":"https://api.github.com/users/NealJMD/repos","events_url":"https://api.github.com/users/NealJMD/events{/privacy}","received_events_url":"https://api.github.com/users/NealJMD/received_events","type":"User","site_admin":false},"body":"This PR is to take care of two outstanding issues with surveys\r\n- [x] Sondhya needs a way to make dropdowns with many options\r\n- [x] Some survey fields aren't displayed on regular action forms.\r\n\r\nI still need to write some specs for the changes in logic, but the dropdowns are working nicely in my click testing.","created_at":"2016-11-01T03:34:20Z","updated_at":"2016-11-03T17:32:10Z","closed_at":null,"merged_at":null,"merge_commit_sha":"52a74bf59e06bb460ea284bcab73281b0c6b15a6","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/SumOfUs/Champaign/pulls/741/commits","review_comments_url":"https://api.github.com/repos/SumOfUs/Champaign/pulls/741/comments","review_comment_url":"https://api.github.com/repos/SumOfUs/Champaign/pulls/comments{/number}","comments_url":"https://api.github.com/repos/SumOfUs/Champaign/issues/741/comments","statuses_url":"https://api.github.com/repos/SumOfUs/Champaign/statuses/18353daaee4f2c857e4301eb827554a8ef4387dd","head":{"label":"SumOfUs:survey-dropdown","ref":"survey-dropdown","sha":"18353daaee4f2c857e4301eb827554a8ef4387dd","user":{"login":"SumOfUs","id":7574652,"avatar_url":"https://avatars.githubusercontent.com/u/7574652?v=3","gravatar_id":"","url":"https://api.github.com/users/SumOfUs","html_url":"https://github.com/SumOfUs","followers_url":"https://api.github.com/users/SumOfUs/followers","following_url":"https://api.github.com/users/SumOfUs/following{/other_user}","gists_url":"https://api.github.com/users/SumOfUs/gists{/gist_id}","starred_url":"https://api.github.com/users/SumOfUs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SumOfUs/subscriptions","organizations_url":"https://api.github.com/users/SumOfUs/orgs","repos_url":"https://api.github.com/users/SumOfUs/repos","events_url":"https://api.github.com/users/SumOfUs/events{/privacy}","received_events_url":"https://api.github.com/users/SumOfUs/received_events","type":"Organization","site_admin":false},"repo":{"id":33684818,"name":"Champaign","full_name":"SumOfUs/Champaign","owner":{"login":"SumOfUs","id":7574652,"avatar_url":"https://avatars.githubusercontent.com/u/7574652?v=3","gravatar_id":"","url":"https://api.github.com/users/SumOfUs","html_url":"https://github.com/SumOfUs","followers_url":"https://api.github.com/users/SumOfUs/followers","following_url":"https://api.github.com/users/SumOfUs/following{/other_user}","gists_url":"https://api.github.com/users/SumOfUs/gists{/gist_id}","starred_url":"https://api.github.com/users/SumOfUs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SumOfUs/subscriptions","organizations_url":"https://api.github.com/users/SumOfUs/orgs","repos_url":"https://api.github.com/users/SumOfUs/repos","events_url":"https://api.github.com/users/SumOfUs/events{/privacy}","received_events_url":"https://api.github.com/users/SumOfUs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/SumOfUs/Champaign","description":"SumOfUs Online Campaign Platform.","fork":false,"url":"https://api.github.com/repos/SumOfUs/Champaign","forks_url":"https://api.github.com/repos/SumOfUs/Champaign/forks","keys_url":"https://api.github.com/repos/SumOfUs/Champaign/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SumOfUs/Champaign/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SumOfUs/Champaign/teams","hooks_url":"https://api.github.com/repos/SumOfUs/Champaign/hooks","issue_events_url":"https://api.github.com/repos/SumOfUs/Champaign/issues/events{/number}","events_url":"https://api.github.com/repos/SumOfUs/Champaign/events","assignees_url":"https://api.github.com/repos/SumOfUs/Champaign/assignees{/user}","branches_url":"https://api.github.com/repos/SumOfUs/Champaign/branches{/branch}","tags_url":"https://api.github.com/repos/SumOfUs/Champaign/tags","blobs_url":"https://api.github.com/repos/SumOfUs/Champaign/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SumOfUs/Champaign/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SumOfUs/Champaign/git/refs{/sha}","trees_url":"https://api.github.com/repos/SumOfUs/Champaign/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SumOfUs/Champaign/statuses/{sha}","languages_url":"https://api.github.com/repos/SumOfUs/Champaign/languages","stargazers_url":"https://api.github.com/repos/SumOfUs/Champaign/stargazers","contributors_url":"https://api.github.com/repos/SumOfUs/Champaign/contributors","subscribers_url":"https://api.github.com/repos/SumOfUs/Champaign/subscribers","subscription_url":"https://api.github.com/repos/SumOfUs/Champaign/subscription","commits_url":"https://api.github.com/repos/SumOfUs/Champaign/commits{/sha}","git_commits_url":"https://api.github.com/repos/SumOfUs/Champaign/git/commits{/sha}","comments_url":"https://api.github.com/repos/SumOfUs/Champaign/comments{/number}","issue_comment_url":"https://api.github.com/repos/SumOfUs/Champaign/issues/comments{/number}","contents_url":"https://api.github.com/repos/SumOfUs/Champaign/contents/{+path}","compare_url":"https://api.github.com/repos/SumOfUs/Champaign/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SumOfUs/Champaign/merges","archive_url":"https://api.github.com/repos/SumOfUs/Champaign/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SumOfUs/Champaign/downloads","issues_url":"https://api.github.com/repos/SumOfUs/Champaign/issues{/number}","pulls_url":"https://api.github.com/repos/SumOfUs/Champaign/pulls{/number}","milestones_url":"https://api.github.com/repos/SumOfUs/Champaign/milestones{/number}","notifications_url":"https://api.github.com/repos/SumOfUs/Champaign/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SumOfUs/Champaign/labels{/name}","releases_url":"https://api.github.com/repos/SumOfUs/Champaign/releases{/id}","deployments_url":"https://api.github.com/repos/SumOfUs/Champaign/deployments","created_at":"2015-04-09T18:16:20Z","updated_at":"2016-10-24T08:25:48Z","pushed_at":"2016-11-03T15:42:28Z","git_url":"git://github.com/SumOfUs/Champaign.git","ssh_url":"git@github.com:SumOfUs/Champaign.git","clone_url":"https://github.com/SumOfUs/Champaign.git","svn_url":"https://github.com/SumOfUs/Champaign","homepage":null,"size":11681,"stargazers_count":25,"watchers_count":25,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":9,"mirror_url":null,"open_issues_count":17,"forks":9,"open_issues":17,"watchers":25,"default_branch":"development"}},"base":{"label":"SumOfUs:development","ref":"development","sha":"33b052a356e7649e15f914957600e64ba141fb2c","user":{"login":"SumOfUs","id":7574652,"avatar_url":"https://avatars.githubusercontent.com/u/7574652?v=3","gravatar_id":"","url":"https://api.github.com/users/SumOfUs","html_url":"https://github.com/SumOfUs","followers_url":"https://api.github.com/users/SumOfUs/followers","following_url":"https://api.github.com/users/SumOfUs/following{/other_user}","gists_url":"https://api.github.com/users/SumOfUs/gists{/gist_id}","starred_url":"https://api.github.com/users/SumOfUs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SumOfUs/subscriptions","organizations_url":"https://api.github.com/users/SumOfUs/orgs","repos_url":"https://api.github.com/users/SumOfUs/repos","events_url":"https://api.github.com/users/SumOfUs/events{/privacy}","received_events_url":"https://api.github.com/users/SumOfUs/received_events","type":"Organization","site_admin":false},"repo":{"id":33684818,"name":"Champaign","full_name":"SumOfUs/Champaign","owner":{"login":"SumOfUs","id":7574652,"avatar_url":"https://avatars.githubusercontent.com/u/7574652?v=3","gravatar_id":"","url":"https://api.github.com/users/SumOfUs","html_url":"https://github.com/SumOfUs","followers_url":"https://api.github.com/users/SumOfUs/followers","following_url":"https://api.github.com/users/SumOfUs/following{/other_user}","gists_url":"https://api.github.com/users/SumOfUs/gists{/gist_id}","starred_url":"https://api.github.com/users/SumOfUs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SumOfUs/subscriptions","organizations_url":"https://api.github.com/users/SumOfUs/orgs","repos_url":"https://api.github.com/users/SumOfUs/repos","events_url":"https://api.github.com/users/SumOfUs/events{/privacy}","received_events_url":"https://api.github.com/users/SumOfUs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/SumOfUs/Champaign","description":"SumOfUs Online Campaign Platform.","fork":false,"url":"https://api.github.com/repos/SumOfUs/Champaign","forks_url":"https://api.github.com/repos/SumOfUs/Champaign/forks","keys_url":"https://api.github.com/repos/SumOfUs/Champaign/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SumOfUs/Champaign/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SumOfUs/Champaign/teams","hooks_url":"https://api.github.com/repos/SumOfUs/Champaign/hooks","issue_events_url":"https://api.github.com/repos/SumOfUs/Champaign/issues/events{/number}","events_url":"https://api.github.com/repos/SumOfUs/Champaign/events","assignees_url":"https://api.github.com/repos/SumOfUs/Champaign/assignees{/user}","branches_url":"https://api.github.com/repos/SumOfUs/Champaign/branches{/branch}","tags_url":"https://api.github.com/repos/SumOfUs/Champaign/tags","blobs_url":"https://api.github.com/repos/SumOfUs/Champaign/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SumOfUs/Champaign/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SumOfUs/Champaign/git/refs{/sha}","trees_url":"https://api.github.com/repos/SumOfUs/Champaign/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SumOfUs/Champaign/statuses/{sha}","languages_url":"https://api.github.com/repos/SumOfUs/Champaign/languages","stargazers_url":"https://api.github.com/repos/SumOfUs/Champaign/stargazers","contributors_url":"https://api.github.com/repos/SumOfUs/Champaign/contributors","subscribers_url":"https://api.github.com/repos/SumOfUs/Champaign/subscribers","subscription_url":"https://api.github.com/repos/SumOfUs/Champaign/subscription","commits_url":"https://api.github.com/repos/SumOfUs/Champaign/commits{/sha}","git_commits_url":"https://api.github.com/repos/SumOfUs/Champaign/git/commits{/sha}","comments_url":"https://api.github.com/repos/SumOfUs/Champaign/comments{/number}","issue_comment_url":"https://api.github.com/repos/SumOfUs/Champaign/issues/comments{/number}","contents_url":"https://api.github.com/repos/SumOfUs/Champaign/contents/{+path}","compare_url":"https://api.github.com/repos/SumOfUs/Champaign/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SumOfUs/Champaign/merges","archive_url":"https://api.github.com/repos/SumOfUs/Champaign/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SumOfUs/Champaign/downloads","issues_url":"https://api.github.com/repos/SumOfUs/Champaign/issues{/number}","pulls_url":"https://api.github.com/repos/SumOfUs/Champaign/pulls{/number}","milestones_url":"https://api.github.com/repos/SumOfUs/Champaign/milestones{/number}","notifications_url":"https://api.github.com/repos/SumOfUs/Champaign/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SumOfUs/Champaign/labels{/name}","releases_url":"https://api.github.com/repos/SumOfUs/Champaign/releases{/id}","deployments_url":"https://api.github.com/repos/SumOfUs/Champaign/deployments","created_at":"2015-04-09T18:16:20Z","updated_at":"2016-10-24T08:25:48Z","pushed_at":"2016-11-03T15:42:28Z","git_url":"git://github.com/SumOfUs/Champaign.git","ssh_url":"git@github.com:SumOfUs/Champaign.git","clone_url":"https://github.com/SumOfUs/Champaign.git","svn_url":"https://github.com/SumOfUs/Champaign","homepage":null,"size":11681,"stargazers_count":25,"watchers_count":25,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":9,"mirror_url":null,"open_issues_count":17,"forks":9,"open_issues":17,"watchers":25,"default_branch":"development"}},"_links":{"self":{"href":"https://api.github.com/repos/SumOfUs/Champaign/pulls/741"},"html":{"href":"https://github.com/SumOfUs/Champaign/pull/741"},"issue":{"href":"https://api.github.com/repos/SumOfUs/Champaign/issues/741"},"comments":{"href":"https://api.github.com/repos/SumOfUs/Champaign/issues/741/comments"},"review_comments":{"href":"https://api.github.com/repos/SumOfUs/Champaign/pulls/741/comments"},"review_comment":{"href":"https://api.github.com/repos/SumOfUs/Champaign/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/SumOfUs/Champaign/pulls/741/commits"},"statuses":{"href":"https://api.github.com/repos/SumOfUs/Champaign/statuses/18353daaee4f2c857e4301eb827554a8ef4387dd"}}}}
{"actor":{"display_login":"osahyoun"}}