{"action":"created","comment":{"url":"https://api.github.com/repos/democracyworks/election-authority-works/pulls/comments/45116976","id":45116976,"diff_hunk":"@@ -12,25 +12,25 @@\n    :instruction/text text})\n \n (defn voting-method->tx-data\n-  [{:keys [type instructions] :as voting-method}]\n-  (when voting-method\n-    (tx/dissoc-optional-nil-values\n-     {:voting-method/type type\n-      :voting-method/instruction (when (seq instructions)\n-                                   (map instruction->tx-data instructions))}\n-     [:voting-method/instruction])))\n-\n-(tx/deftx-data-fn address->tx-data\n-  [street street-2 city state zip routing-code]\n-  (let [routing-code (or routing-code (string/replace zip #\"\\D\" \"\"))\n-        create-map {:db/id ?id\n-                    :address/street street\n-                    :address/street-2 street-2\n-                    :address/city city\n-                    :address/state state\n-                    :address/zip zip\n-                    :address/routing-code routing-code}]\n-    [(tx/dissoc-optional-nil-values create-map [:address/street-2])]))\n+  [{:keys [type instructions]}]\n+  (tx/dissoc-optional-nil-values\n+   {:voting-method/type\n+    type\n+\n+    :voting-method/instruction\n+    (not-empty (map instruction->tx-data instructions))}\n+   [:voting-method/instruction]))\n+\n+(defn address->tx-map\n+  [{:keys [street street-2 city state zip routing-code]}]\n+  (tx/dissoc-optional-nil-values\n+   {:address/street street\n+    :address/street-2 street-2\n+    :address/city city\n+    :address/state state\n+    :address/zip zip\n+    :address/routing-code routing-code}","path":"src/election_authority_works/entities/authority.clj","position":40,"original_position":40,"commit_id":"c759499fad309deca948eaab294bb446f9ac8cfa","original_commit_id":"c759499fad309deca948eaab294bb446f9ac8cfa","user":{"login":"cap10morgan","id":59748,"avatar_url":"https://avatars.githubusercontent.com/u/59748?v=3","gravatar_id":"","url":"https://api.github.com/users/cap10morgan","html_url":"https://github.com/cap10morgan","followers_url":"https://api.github.com/users/cap10morgan/followers","following_url":"https://api.github.com/users/cap10morgan/following{/other_user}","gists_url":"https://api.github.com/users/cap10morgan/gists{/gist_id}","starred_url":"https://api.github.com/users/cap10morgan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cap10morgan/subscriptions","organizations_url":"https://api.github.com/users/cap10morgan/orgs","repos_url":"https://api.github.com/users/cap10morgan/repos","events_url":"https://api.github.com/users/cap10morgan/events{/privacy}","received_events_url":"https://api.github.com/users/cap10morgan/received_events","type":"User","site_admin":false},"body":"It looks like we were setting the `routing-code` to the numeric characters in the `zip` when it wasn't given before. Should we preserve that?","created_at":"2015-11-17T20:38:20Z","updated_at":"2015-11-17T20:38:20Z","html_url":"https://github.com/democracyworks/election-authority-works/pull/15#discussion_r45116976","pull_request_url":"https://api.github.com/repos/democracyworks/election-authority-works/pulls/15","_links":{"self":{"href":"https://api.github.com/repos/democracyworks/election-authority-works/pulls/comments/45116976"},"html":{"href":"https://github.com/democracyworks/election-authority-works/pull/15#discussion_r45116976"},"pull_request":{"href":"https://api.github.com/repos/democracyworks/election-authority-works/pulls/15"}}},"pull_request":{"url":"https://api.github.com/repos/democracyworks/election-authority-works/pulls/15","id":50970775,"html_url":"https://github.com/democracyworks/election-authority-works/pull/15","diff_url":"https://github.com/democracyworks/election-authority-works/pull/15.diff","patch_url":"https://github.com/democracyworks/election-authority-works/pull/15.patch","issue_url":"https://api.github.com/repos/democracyworks/election-authority-works/issues/15","number":15,"state":"open","locked":false,"title":"Race instructions","user":{"login":"ericnormand","id":116172,"avatar_url":"https://avatars.githubusercontent.com/u/116172?v=3","gravatar_id":"","url":"https://api.github.com/users/ericnormand","html_url":"https://github.com/ericnormand","followers_url":"https://api.github.com/users/ericnormand/followers","following_url":"https://api.github.com/users/ericnormand/following{/other_user}","gists_url":"https://api.github.com/users/ericnormand/gists{/gist_id}","starred_url":"https://api.github.com/users/ericnormand/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ericnormand/subscriptions","organizations_url":"https://api.github.com/users/ericnormand/orgs","repos_url":"https://api.github.com/users/ericnormand/repos","events_url":"https://api.github.com/users/ericnormand/events{/privacy}","received_events_url":"https://api.github.com/users/ericnormand/received_events","type":"User","site_admin":false},"body":"Add race instructions to election-authority-works.\r\n\r\nThis required some data model changes.\r\n\r\n1. We made a lot of office-specific information optional. For instance, we no longer require an authority name.\r\n2. We made create-authority idempotent.\r\n3. This involved upgrading datomic toolbox. (done in another PR)\r\n4. Idempotency involved race conditions, so we dealt with that card. ([Pivotal Card](https://www.pivotaltracker.com/story/show/108284280))\r\n\r\nAll for a little chore! [Pivotal Card](https://www.pivotaltracker.com/story/show/103463914)","created_at":"2015-11-17T16:39:35Z","updated_at":"2015-11-17T20:38:20Z","closed_at":null,"merged_at":null,"merge_commit_sha":"592f370f7dc10648be56559ce14a33d9daf8b409","assignee":{"login":"cap10morgan","id":59748,"avatar_url":"https://avatars.githubusercontent.com/u/59748?v=3","gravatar_id":"","url":"https://api.github.com/users/cap10morgan","html_url":"https://github.com/cap10morgan","followers_url":"https://api.github.com/users/cap10morgan/followers","following_url":"https://api.github.com/users/cap10morgan/following{/other_user}","gists_url":"https://api.github.com/users/cap10morgan/gists{/gist_id}","starred_url":"https://api.github.com/users/cap10morgan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cap10morgan/subscriptions","organizations_url":"https://api.github.com/users/cap10morgan/orgs","repos_url":"https://api.github.com/users/cap10morgan/repos","events_url":"https://api.github.com/users/cap10morgan/events{/privacy}","received_events_url":"https://api.github.com/users/cap10morgan/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/democracyworks/election-authority-works/pulls/15/commits","review_comments_url":"https://api.github.com/repos/democracyworks/election-authority-works/pulls/15/comments","review_comment_url":"https://api.github.com/repos/democracyworks/election-authority-works/pulls/comments{/number}","comments_url":"https://api.github.com/repos/democracyworks/election-authority-works/issues/15/comments","statuses_url":"https://api.github.com/repos/democracyworks/election-authority-works/statuses/c759499fad309deca948eaab294bb446f9ac8cfa","head":{"label":"democracyworks:race-instructions","ref":"race-instructions","sha":"c759499fad309deca948eaab294bb446f9ac8cfa","user":{"login":"democracyworks","id":1373557,"avatar_url":"https://avatars.githubusercontent.com/u/1373557?v=3","gravatar_id":"","url":"https://api.github.com/users/democracyworks","html_url":"https://github.com/democracyworks","followers_url":"https://api.github.com/users/democracyworks/followers","following_url":"https://api.github.com/users/democracyworks/following{/other_user}","gists_url":"https://api.github.com/users/democracyworks/gists{/gist_id}","starred_url":"https://api.github.com/users/democracyworks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/democracyworks/subscriptions","organizations_url":"https://api.github.com/users/democracyworks/orgs","repos_url":"https://api.github.com/users/democracyworks/repos","events_url":"https://api.github.com/users/democracyworks/events{/privacy}","received_events_url":"https://api.github.com/users/democracyworks/received_events","type":"Organization","site_admin":false},"repo":{"id":37270076,"name":"election-authority-works","full_name":"democracyworks/election-authority-works","owner":{"login":"democracyworks","id":1373557,"avatar_url":"https://avatars.githubusercontent.com/u/1373557?v=3","gravatar_id":"","url":"https://api.github.com/users/democracyworks","html_url":"https://github.com/democracyworks","followers_url":"https://api.github.com/users/democracyworks/followers","following_url":"https://api.github.com/users/democracyworks/following{/other_user}","gists_url":"https://api.github.com/users/democracyworks/gists{/gist_id}","starred_url":"https://api.github.com/users/democracyworks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/democracyworks/subscriptions","organizations_url":"https://api.github.com/users/democracyworks/orgs","repos_url":"https://api.github.com/users/democracyworks/repos","events_url":"https://api.github.com/users/democracyworks/events{/privacy}","received_events_url":"https://api.github.com/users/democracyworks/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/democracyworks/election-authority-works","description":"","fork":false,"url":"https://api.github.com/repos/democracyworks/election-authority-works","forks_url":"https://api.github.com/repos/democracyworks/election-authority-works/forks","keys_url":"https://api.github.com/repos/democracyworks/election-authority-works/keys{/key_id}","collaborators_url":"https://api.github.com/repos/democracyworks/election-authority-works/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/democracyworks/election-authority-works/teams","hooks_url":"https://api.github.com/repos/democracyworks/election-authority-works/hooks","issue_events_url":"https://api.github.com/repos/democracyworks/election-authority-works/issues/events{/number}","events_url":"https://api.github.com/repos/democracyworks/election-authority-works/events","assignees_url":"https://api.github.com/repos/democracyworks/election-authority-works/assignees{/user}","branches_url":"https://api.github.com/repos/democracyworks/election-authority-works/branches{/branch}","tags_url":"https://api.github.com/repos/democracyworks/election-authority-works/tags","blobs_url":"https://api.github.com/repos/democracyworks/election-authority-works/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/democracyworks/election-authority-works/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/democracyworks/election-authority-works/git/refs{/sha}","trees_url":"https://api.github.com/repos/democracyworks/election-authority-works/git/trees{/sha}","statuses_url":"https://api.github.com/repos/democracyworks/election-authority-works/statuses/{sha}","languages_url":"https://api.github.com/repos/democracyworks/election-authority-works/languages","stargazers_url":"https://api.github.com/repos/democracyworks/election-authority-works/stargazers","contributors_url":"https://api.github.com/repos/democracyworks/election-authority-works/contributors","subscribers_url":"https://api.github.com/repos/democracyworks/election-authority-works/subscribers","subscription_url":"https://api.github.com/repos/democracyworks/election-authority-works/subscription","commits_url":"https://api.github.com/repos/democracyworks/election-authority-works/commits{/sha}","git_commits_url":"https://api.github.com/repos/democracyworks/election-authority-works/git/commits{/sha}","comments_url":"https://api.github.com/repos/democracyworks/election-authority-works/comments{/number}","issue_comment_url":"https://api.github.com/repos/democracyworks/election-authority-works/issues/comments{/number}","contents_url":"https://api.github.com/repos/democracyworks/election-authority-works/contents/{+path}","compare_url":"https://api.github.com/repos/democracyworks/election-authority-works/compare/{base}...{head}","merges_url":"https://api.github.com/repos/democracyworks/election-authority-works/merges","archive_url":"https://api.github.com/repos/democracyworks/election-authority-works/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/democracyworks/election-authority-works/downloads","issues_url":"https://api.github.com/repos/democracyworks/election-authority-works/issues{/number}","pulls_url":"https://api.github.com/repos/democracyworks/election-authority-works/pulls{/number}","milestones_url":"https://api.github.com/repos/democracyworks/election-authority-works/milestones{/number}","notifications_url":"https://api.github.com/repos/democracyworks/election-authority-works/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/democracyworks/election-authority-works/labels{/name}","releases_url":"https://api.github.com/repos/democracyworks/election-authority-works/releases{/id}","created_at":"2015-06-11T15:38:40Z","updated_at":"2015-11-17T00:52:07Z","pushed_at":"2015-11-17T20:35:23Z","git_url":"git://github.com/democracyworks/election-authority-works.git","ssh_url":"git@github.com:democracyworks/election-authority-works.git","clone_url":"https://github.com/democracyworks/election-authority-works.git","svn_url":"https://github.com/democracyworks/election-authority-works","homepage":null,"size":102,"stargazers_count":0,"watchers_count":0,"language":"Clojure","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":0,"default_branch":"master"}},"base":{"label":"democracyworks:master","ref":"master","sha":"48f661ec072e60cef2b8b2fec224b46cf4526363","user":{"login":"democracyworks","id":1373557,"avatar_url":"https://avatars.githubusercontent.com/u/1373557?v=3","gravatar_id":"","url":"https://api.github.com/users/democracyworks","html_url":"https://github.com/democracyworks","followers_url":"https://api.github.com/users/democracyworks/followers","following_url":"https://api.github.com/users/democracyworks/following{/other_user}","gists_url":"https://api.github.com/users/democracyworks/gists{/gist_id}","starred_url":"https://api.github.com/users/democracyworks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/democracyworks/subscriptions","organizations_url":"https://api.github.com/users/democracyworks/orgs","repos_url":"https://api.github.com/users/democracyworks/repos","events_url":"https://api.github.com/users/democracyworks/events{/privacy}","received_events_url":"https://api.github.com/users/democracyworks/received_events","type":"Organization","site_admin":false},"repo":{"id":37270076,"name":"election-authority-works","full_name":"democracyworks/election-authority-works","owner":{"login":"democracyworks","id":1373557,"avatar_url":"https://avatars.githubusercontent.com/u/1373557?v=3","gravatar_id":"","url":"https://api.github.com/users/democracyworks","html_url":"https://github.com/democracyworks","followers_url":"https://api.github.com/users/democracyworks/followers","following_url":"https://api.github.com/users/democracyworks/following{/other_user}","gists_url":"https://api.github.com/users/democracyworks/gists{/gist_id}","starred_url":"https://api.github.com/users/democracyworks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/democracyworks/subscriptions","organizations_url":"https://api.github.com/users/democracyworks/orgs","repos_url":"https://api.github.com/users/democracyworks/repos","events_url":"https://api.github.com/users/democracyworks/events{/privacy}","received_events_url":"https://api.github.com/users/democracyworks/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/democracyworks/election-authority-works","description":"","fork":false,"url":"https://api.github.com/repos/democracyworks/election-authority-works","forks_url":"https://api.github.com/repos/democracyworks/election-authority-works/forks","keys_url":"https://api.github.com/repos/democracyworks/election-authority-works/keys{/key_id}","collaborators_url":"https://api.github.com/repos/democracyworks/election-authority-works/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/democracyworks/election-authority-works/teams","hooks_url":"https://api.github.com/repos/democracyworks/election-authority-works/hooks","issue_events_url":"https://api.github.com/repos/democracyworks/election-authority-works/issues/events{/number}","events_url":"https://api.github.com/repos/democracyworks/election-authority-works/events","assignees_url":"https://api.github.com/repos/democracyworks/election-authority-works/assignees{/user}","branches_url":"https://api.github.com/repos/democracyworks/election-authority-works/branches{/branch}","tags_url":"https://api.github.com/repos/democracyworks/election-authority-works/tags","blobs_url":"https://api.github.com/repos/democracyworks/election-authority-works/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/democracyworks/election-authority-works/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/democracyworks/election-authority-works/git/refs{/sha}","trees_url":"https://api.github.com/repos/democracyworks/election-authority-works/git/trees{/sha}","statuses_url":"https://api.github.com/repos/democracyworks/election-authority-works/statuses/{sha}","languages_url":"https://api.github.com/repos/democracyworks/election-authority-works/languages","stargazers_url":"https://api.github.com/repos/democracyworks/election-authority-works/stargazers","contributors_url":"https://api.github.com/repos/democracyworks/election-authority-works/contributors","subscribers_url":"https://api.github.com/repos/democracyworks/election-authority-works/subscribers","subscription_url":"https://api.github.com/repos/democracyworks/election-authority-works/subscription","commits_url":"https://api.github.com/repos/democracyworks/election-authority-works/commits{/sha}","git_commits_url":"https://api.github.com/repos/democracyworks/election-authority-works/git/commits{/sha}","comments_url":"https://api.github.com/repos/democracyworks/election-authority-works/comments{/number}","issue_comment_url":"https://api.github.com/repos/democracyworks/election-authority-works/issues/comments{/number}","contents_url":"https://api.github.com/repos/democracyworks/election-authority-works/contents/{+path}","compare_url":"https://api.github.com/repos/democracyworks/election-authority-works/compare/{base}...{head}","merges_url":"https://api.github.com/repos/democracyworks/election-authority-works/merges","archive_url":"https://api.github.com/repos/democracyworks/election-authority-works/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/democracyworks/election-authority-works/downloads","issues_url":"https://api.github.com/repos/democracyworks/election-authority-works/issues{/number}","pulls_url":"https://api.github.com/repos/democracyworks/election-authority-works/pulls{/number}","milestones_url":"https://api.github.com/repos/democracyworks/election-authority-works/milestones{/number}","notifications_url":"https://api.github.com/repos/democracyworks/election-authority-works/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/democracyworks/election-authority-works/labels{/name}","releases_url":"https://api.github.com/repos/democracyworks/election-authority-works/releases{/id}","created_at":"2015-06-11T15:38:40Z","updated_at":"2015-11-17T00:52:07Z","pushed_at":"2015-11-17T20:35:23Z","git_url":"git://github.com/democracyworks/election-authority-works.git","ssh_url":"git@github.com:democracyworks/election-authority-works.git","clone_url":"https://github.com/democracyworks/election-authority-works.git","svn_url":"https://github.com/democracyworks/election-authority-works","homepage":null,"size":102,"stargazers_count":0,"watchers_count":0,"language":"Clojure","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/democracyworks/election-authority-works/pulls/15"},"html":{"href":"https://github.com/democracyworks/election-authority-works/pull/15"},"issue":{"href":"https://api.github.com/repos/democracyworks/election-authority-works/issues/15"},"comments":{"href":"https://api.github.com/repos/democracyworks/election-authority-works/issues/15/comments"},"review_comments":{"href":"https://api.github.com/repos/democracyworks/election-authority-works/pulls/15/comments"},"review_comment":{"href":"https://api.github.com/repos/democracyworks/election-authority-works/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/democracyworks/election-authority-works/pulls/15/commits"},"statuses":{"href":"https://api.github.com/repos/democracyworks/election-authority-works/statuses/c759499fad309deca948eaab294bb446f9ac8cfa"}}}}