{"action":"closed","number":324,"pull_request":{"url":"https://api.github.com/repos/moneyadviceservice/rad/pulls/324","id":50403078,"html_url":"https://github.com/moneyadviceservice/rad/pull/324","diff_url":"https://github.com/moneyadviceservice/rad/pull/324.diff","patch_url":"https://github.com/moneyadviceservice/rad/pull/324.patch","issue_url":"https://api.github.com/repos/moneyadviceservice/rad/issues/324","number":324,"state":"closed","locked":false,"title":"Geocoding offices and advisers with feedback if it fails","user":{"login":"munckymagik","id":306583,"avatar_url":"https://avatars.githubusercontent.com/u/306583?v=3","gravatar_id":"","url":"https://api.github.com/users/munckymagik","html_url":"https://github.com/munckymagik","followers_url":"https://api.github.com/users/munckymagik/followers","following_url":"https://api.github.com/users/munckymagik/following{/other_user}","gists_url":"https://api.github.com/users/munckymagik/gists{/gist_id}","starred_url":"https://api.github.com/users/munckymagik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/munckymagik/subscriptions","organizations_url":"https://api.github.com/users/munckymagik/orgs","repos_url":"https://api.github.com/users/munckymagik/repos","events_url":"https://api.github.com/users/munckymagik/events{/privacy}","received_events_url":"https://api.github.com/users/munckymagik/received_events","type":"User","site_admin":false},"body":"## Summary\r\n\r\nThis set of changes integrates the work done in mas-rad_core to:\r\n\r\n* Make offices geocodable\r\n* Make it so both office and adviser geocoding errors can be reported to the user at the moment they try to save.\r\n\r\nNow neither advisers nor offices can be saved without successfully being geocoded. This reduces the number of possible states the model can be in, hopefully making it simpler to reason about how the system should work and what data should be visible in the directory.\r\n\r\n## Things to note\r\n\r\nVCR has been added as we now need to stub out requests to the geocoding service. Previously when all geocoding and indexing was triggered by `after_commit` hooks no remote requests were being triggered. This was due to the [`DatabaseClearner.strategy` being set to `:transaction`](https://github.com/moneyadviceservice/rad/blob/master/spec/support/database_cleaner.rb#L7) - commits never happened so the callbacks were not triggered. The change now is because geocoding is done as a wrapper around save and update.\r\n\r\nNote indexing is still done on an `after_commit` so that doesn't need to be stubbed out.\r\n\r\n## UI changes\r\n\r\n### Offices\r\n\r\nWhen saving an address whose postcode cannot be geocoded the user gets feedback.\r\n\r\n![screen shot 2015-11-11 at 12 29 55](https://cloud.githubusercontent.com/assets/306583/11095949/7621da8e-888f-11e5-8dc1-e00add3d02a6.png)\r\n\r\n### Advisers\r\n\r\nSame situation now with advisers too.\r\n\r\n![screen shot 2015-11-11 at 12 34 30](https://cloud.githubusercontent.com/assets/306583/11095968/90e25d76-888f-11e5-906b-1b736f654b0a.png)\r\n","created_at":"2015-11-11T16:24:07Z","updated_at":"2015-11-12T10:33:07Z","closed_at":"2015-11-12T10:33:07Z","merged_at":"2015-11-12T10:33:07Z","merge_commit_sha":"02e572fd7658e78fa4e4e5371f59e3162c6c9fd6","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/moneyadviceservice/rad/pulls/324/commits","review_comments_url":"https://api.github.com/repos/moneyadviceservice/rad/pulls/324/comments","review_comment_url":"https://api.github.com/repos/moneyadviceservice/rad/pulls/comments{/number}","comments_url":"https://api.github.com/repos/moneyadviceservice/rad/issues/324/comments","statuses_url":"https://api.github.com/repos/moneyadviceservice/rad/statuses/4d7b76ca38578017bfbcb314dd968ea2add97952","head":{"label":"moneyadviceservice:geocoding_offices","ref":"geocoding_offices","sha":"4d7b76ca38578017bfbcb314dd968ea2add97952","user":{"login":"moneyadviceservice","id":2064781,"avatar_url":"https://avatars.githubusercontent.com/u/2064781?v=3","gravatar_id":"","url":"https://api.github.com/users/moneyadviceservice","html_url":"https://github.com/moneyadviceservice","followers_url":"https://api.github.com/users/moneyadviceservice/followers","following_url":"https://api.github.com/users/moneyadviceservice/following{/other_user}","gists_url":"https://api.github.com/users/moneyadviceservice/gists{/gist_id}","starred_url":"https://api.github.com/users/moneyadviceservice/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/moneyadviceservice/subscriptions","organizations_url":"https://api.github.com/users/moneyadviceservice/orgs","repos_url":"https://api.github.com/users/moneyadviceservice/repos","events_url":"https://api.github.com/users/moneyadviceservice/events{/privacy}","received_events_url":"https://api.github.com/users/moneyadviceservice/received_events","type":"Organization","site_admin":false},"repo":{"id":26871523,"name":"rad","full_name":"moneyadviceservice/rad","owner":{"login":"moneyadviceservice","id":2064781,"avatar_url":"https://avatars.githubusercontent.com/u/2064781?v=3","gravatar_id":"","url":"https://api.github.com/users/moneyadviceservice","html_url":"https://github.com/moneyadviceservice","followers_url":"https://api.github.com/users/moneyadviceservice/followers","following_url":"https://api.github.com/users/moneyadviceservice/following{/other_user}","gists_url":"https://api.github.com/users/moneyadviceservice/gists{/gist_id}","starred_url":"https://api.github.com/users/moneyadviceservice/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/moneyadviceservice/subscriptions","organizations_url":"https://api.github.com/users/moneyadviceservice/orgs","repos_url":"https://api.github.com/users/moneyadviceservice/repos","events_url":"https://api.github.com/users/moneyadviceservice/events{/privacy}","received_events_url":"https://api.github.com/users/moneyadviceservice/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/moneyadviceservice/rad","description":"Retirement Adviser Directory","fork":false,"url":"https://api.github.com/repos/moneyadviceservice/rad","forks_url":"https://api.github.com/repos/moneyadviceservice/rad/forks","keys_url":"https://api.github.com/repos/moneyadviceservice/rad/keys{/key_id}","collaborators_url":"https://api.github.com/repos/moneyadviceservice/rad/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/moneyadviceservice/rad/teams","hooks_url":"https://api.github.com/repos/moneyadviceservice/rad/hooks","issue_events_url":"https://api.github.com/repos/moneyadviceservice/rad/issues/events{/number}","events_url":"https://api.github.com/repos/moneyadviceservice/rad/events","assignees_url":"https://api.github.com/repos/moneyadviceservice/rad/assignees{/user}","branches_url":"https://api.github.com/repos/moneyadviceservice/rad/branches{/branch}","tags_url":"https://api.github.com/repos/moneyadviceservice/rad/tags","blobs_url":"https://api.github.com/repos/moneyadviceservice/rad/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/moneyadviceservice/rad/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/moneyadviceservice/rad/git/refs{/sha}","trees_url":"https://api.github.com/repos/moneyadviceservice/rad/git/trees{/sha}","statuses_url":"https://api.github.com/repos/moneyadviceservice/rad/statuses/{sha}","languages_url":"https://api.github.com/repos/moneyadviceservice/rad/languages","stargazers_url":"https://api.github.com/repos/moneyadviceservice/rad/stargazers","contributors_url":"https://api.github.com/repos/moneyadviceservice/rad/contributors","subscribers_url":"https://api.github.com/repos/moneyadviceservice/rad/subscribers","subscription_url":"https://api.github.com/repos/moneyadviceservice/rad/subscription","commits_url":"https://api.github.com/repos/moneyadviceservice/rad/commits{/sha}","git_commits_url":"https://api.github.com/repos/moneyadviceservice/rad/git/commits{/sha}","comments_url":"https://api.github.com/repos/moneyadviceservice/rad/comments{/number}","issue_comment_url":"https://api.github.com/repos/moneyadviceservice/rad/issues/comments{/number}","contents_url":"https://api.github.com/repos/moneyadviceservice/rad/contents/{+path}","compare_url":"https://api.github.com/repos/moneyadviceservice/rad/compare/{base}...{head}","merges_url":"https://api.github.com/repos/moneyadviceservice/rad/merges","archive_url":"https://api.github.com/repos/moneyadviceservice/rad/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/moneyadviceservice/rad/downloads","issues_url":"https://api.github.com/repos/moneyadviceservice/rad/issues{/number}","pulls_url":"https://api.github.com/repos/moneyadviceservice/rad/pulls{/number}","milestones_url":"https://api.github.com/repos/moneyadviceservice/rad/milestones{/number}","notifications_url":"https://api.github.com/repos/moneyadviceservice/rad/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/moneyadviceservice/rad/labels{/name}","releases_url":"https://api.github.com/repos/moneyadviceservice/rad/releases{/id}","created_at":"2014-11-19T16:55:48Z","updated_at":"2015-06-15T15:36:58Z","pushed_at":"2015-11-12T10:33:07Z","git_url":"git://github.com/moneyadviceservice/rad.git","ssh_url":"git@github.com:moneyadviceservice/rad.git","clone_url":"https://github.com/moneyadviceservice/rad.git","svn_url":"https://github.com/moneyadviceservice/rad","homepage":"","size":6176,"stargazers_count":1,"watchers_count":1,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":0,"forks":1,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"moneyadviceservice:master","ref":"master","sha":"66e190193467bd63687f9c2749ec79cac36b337d","user":{"login":"moneyadviceservice","id":2064781,"avatar_url":"https://avatars.githubusercontent.com/u/2064781?v=3","gravatar_id":"","url":"https://api.github.com/users/moneyadviceservice","html_url":"https://github.com/moneyadviceservice","followers_url":"https://api.github.com/users/moneyadviceservice/followers","following_url":"https://api.github.com/users/moneyadviceservice/following{/other_user}","gists_url":"https://api.github.com/users/moneyadviceservice/gists{/gist_id}","starred_url":"https://api.github.com/users/moneyadviceservice/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/moneyadviceservice/subscriptions","organizations_url":"https://api.github.com/users/moneyadviceservice/orgs","repos_url":"https://api.github.com/users/moneyadviceservice/repos","events_url":"https://api.github.com/users/moneyadviceservice/events{/privacy}","received_events_url":"https://api.github.com/users/moneyadviceservice/received_events","type":"Organization","site_admin":false},"repo":{"id":26871523,"name":"rad","full_name":"moneyadviceservice/rad","owner":{"login":"moneyadviceservice","id":2064781,"avatar_url":"https://avatars.githubusercontent.com/u/2064781?v=3","gravatar_id":"","url":"https://api.github.com/users/moneyadviceservice","html_url":"https://github.com/moneyadviceservice","followers_url":"https://api.github.com/users/moneyadviceservice/followers","following_url":"https://api.github.com/users/moneyadviceservice/following{/other_user}","gists_url":"https://api.github.com/users/moneyadviceservice/gists{/gist_id}","starred_url":"https://api.github.com/users/moneyadviceservice/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/moneyadviceservice/subscriptions","organizations_url":"https://api.github.com/users/moneyadviceservice/orgs","repos_url":"https://api.github.com/users/moneyadviceservice/repos","events_url":"https://api.github.com/users/moneyadviceservice/events{/privacy}","received_events_url":"https://api.github.com/users/moneyadviceservice/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/moneyadviceservice/rad","description":"Retirement Adviser Directory","fork":false,"url":"https://api.github.com/repos/moneyadviceservice/rad","forks_url":"https://api.github.com/repos/moneyadviceservice/rad/forks","keys_url":"https://api.github.com/repos/moneyadviceservice/rad/keys{/key_id}","collaborators_url":"https://api.github.com/repos/moneyadviceservice/rad/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/moneyadviceservice/rad/teams","hooks_url":"https://api.github.com/repos/moneyadviceservice/rad/hooks","issue_events_url":"https://api.github.com/repos/moneyadviceservice/rad/issues/events{/number}","events_url":"https://api.github.com/repos/moneyadviceservice/rad/events","assignees_url":"https://api.github.com/repos/moneyadviceservice/rad/assignees{/user}","branches_url":"https://api.github.com/repos/moneyadviceservice/rad/branches{/branch}","tags_url":"https://api.github.com/repos/moneyadviceservice/rad/tags","blobs_url":"https://api.github.com/repos/moneyadviceservice/rad/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/moneyadviceservice/rad/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/moneyadviceservice/rad/git/refs{/sha}","trees_url":"https://api.github.com/repos/moneyadviceservice/rad/git/trees{/sha}","statuses_url":"https://api.github.com/repos/moneyadviceservice/rad/statuses/{sha}","languages_url":"https://api.github.com/repos/moneyadviceservice/rad/languages","stargazers_url":"https://api.github.com/repos/moneyadviceservice/rad/stargazers","contributors_url":"https://api.github.com/repos/moneyadviceservice/rad/contributors","subscribers_url":"https://api.github.com/repos/moneyadviceservice/rad/subscribers","subscription_url":"https://api.github.com/repos/moneyadviceservice/rad/subscription","commits_url":"https://api.github.com/repos/moneyadviceservice/rad/commits{/sha}","git_commits_url":"https://api.github.com/repos/moneyadviceservice/rad/git/commits{/sha}","comments_url":"https://api.github.com/repos/moneyadviceservice/rad/comments{/number}","issue_comment_url":"https://api.github.com/repos/moneyadviceservice/rad/issues/comments{/number}","contents_url":"https://api.github.com/repos/moneyadviceservice/rad/contents/{+path}","compare_url":"https://api.github.com/repos/moneyadviceservice/rad/compare/{base}...{head}","merges_url":"https://api.github.com/repos/moneyadviceservice/rad/merges","archive_url":"https://api.github.com/repos/moneyadviceservice/rad/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/moneyadviceservice/rad/downloads","issues_url":"https://api.github.com/repos/moneyadviceservice/rad/issues{/number}","pulls_url":"https://api.github.com/repos/moneyadviceservice/rad/pulls{/number}","milestones_url":"https://api.github.com/repos/moneyadviceservice/rad/milestones{/number}","notifications_url":"https://api.github.com/repos/moneyadviceservice/rad/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/moneyadviceservice/rad/labels{/name}","releases_url":"https://api.github.com/repos/moneyadviceservice/rad/releases{/id}","created_at":"2014-11-19T16:55:48Z","updated_at":"2015-06-15T15:36:58Z","pushed_at":"2015-11-12T10:33:07Z","git_url":"git://github.com/moneyadviceservice/rad.git","ssh_url":"git@github.com:moneyadviceservice/rad.git","clone_url":"https://github.com/moneyadviceservice/rad.git","svn_url":"https://github.com/moneyadviceservice/rad","homepage":"","size":6176,"stargazers_count":1,"watchers_count":1,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":0,"forks":1,"open_issues":0,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/moneyadviceservice/rad/pulls/324"},"html":{"href":"https://github.com/moneyadviceservice/rad/pull/324"},"issue":{"href":"https://api.github.com/repos/moneyadviceservice/rad/issues/324"},"comments":{"href":"https://api.github.com/repos/moneyadviceservice/rad/issues/324/comments"},"review_comments":{"href":"https://api.github.com/repos/moneyadviceservice/rad/pulls/324/comments"},"review_comment":{"href":"https://api.github.com/repos/moneyadviceservice/rad/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/moneyadviceservice/rad/pulls/324/commits"},"statuses":{"href":"https://api.github.com/repos/moneyadviceservice/rad/statuses/4d7b76ca38578017bfbcb314dd968ea2add97952"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"munckymagik","id":306583,"avatar_url":"https://avatars.githubusercontent.com/u/306583?v=3","gravatar_id":"","url":"https://api.github.com/users/munckymagik","html_url":"https://github.com/munckymagik","followers_url":"https://api.github.com/users/munckymagik/followers","following_url":"https://api.github.com/users/munckymagik/following{/other_user}","gists_url":"https://api.github.com/users/munckymagik/gists{/gist_id}","starred_url":"https://api.github.com/users/munckymagik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/munckymagik/subscriptions","organizations_url":"https://api.github.com/users/munckymagik/orgs","repos_url":"https://api.github.com/users/munckymagik/repos","events_url":"https://api.github.com/users/munckymagik/events{/privacy}","received_events_url":"https://api.github.com/users/munckymagik/received_events","type":"User","site_admin":false},"comments":4,"review_comments":1,"commits":13,"additions":740,"deletions":44,"changed_files":24}}