{"action":"opened","number":201,"pull_request":{"url":"https://api.github.com/repos/AgileVentures/shf-project/pulls/201","id":113330013,"html_url":"https://github.com/AgileVentures/shf-project/pull/201","diff_url":"https://github.com/AgileVentures/shf-project/pull/201.diff","patch_url":"https://github.com/AgileVentures/shf-project/pull/201.patch","issue_url":"https://api.github.com/repos/AgileVentures/shf-project/issues/201","number":201,"state":"open","locked":false,"title":"BUG: Geocode all companies before showing #index","user":{"login":"weedySeaDragon","id":673794,"avatar_url":"https://avatars3.githubusercontent.com/u/673794?v=3","gravatar_id":"","url":"https://api.github.com/users/weedySeaDragon","html_url":"https://github.com/weedySeaDragon","followers_url":"https://api.github.com/users/weedySeaDragon/followers","following_url":"https://api.github.com/users/weedySeaDragon/following{/other_user}","gists_url":"https://api.github.com/users/weedySeaDragon/gists{/gist_id}","starred_url":"https://api.github.com/users/weedySeaDragon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/weedySeaDragon/subscriptions","organizations_url":"https://api.github.com/users/weedySeaDragon/orgs","repos_url":"https://api.github.com/users/weedySeaDragon/repos","events_url":"https://api.github.com/users/weedySeaDragon/events{/privacy}","received_events_url":"https://api.github.com/users/weedySeaDragon/received_events","type":"User","site_admin":false},"body":"PT Story: **can't map list of companies if they're not geolocated**\r\nhttps://www.pivotaltracker.com/story/show/142716667\r\n\r\nCompany and address data already existed in the production database but they had not yet been geocoded (= no latitude and longitude).  An individual company was geocoded when it was shown (via CompaniesController `.set_company`), but when the list of companies was shown (e.g. `.index`), the companies were not checked to see if they needed to be geocoded.\r\n\r\nThis meant that bad data was sent the javascript used to render the Google map with 'plupps' (marker pins) for the companies, and instead of showing the map, a big, ugly 'Something went wrong' message was shown.\r\n\r\nSusanna figured it out, and she and I manually viewed each company individually so they'd be geocoded. Now that all companies in the production db are geocoded, this shouldn't be a problem again.  But this code will _ensure_ it will never happen again, and this code _should have been in place beforehand._\r\n\r\n### Changes proposed in this pull request:\r\n1.  added an Address class method that will geocode all addresses not yet geocoded `.geocode_all_needed`\r\n2. a rake method to geocode all addresses that need it (calls the Address class method)\r\n3. CompaniesController `index` will now call `geocode_if_needed` for each company in the list of all companies, so every company will be geocoded before they are all displayed on the #index view ( = the Google map!)\r\n4. spec for the Address class method\r\n5. feature (and new steps needed): \"All companies are geocoded before being shown on the view all companies page\"\r\n\r\nReady for review:\r\n@patmbolger @thesuss \r\n","created_at":"2017-03-30T01:43:14Z","updated_at":"2017-03-30T01:43:14Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/AgileVentures/shf-project/pulls/201/commits","review_comments_url":"https://api.github.com/repos/AgileVentures/shf-project/pulls/201/comments","review_comment_url":"https://api.github.com/repos/AgileVentures/shf-project/pulls/comments{/number}","comments_url":"https://api.github.com/repos/AgileVentures/shf-project/issues/201/comments","statuses_url":"https://api.github.com/repos/AgileVentures/shf-project/statuses/1ab0b06776f9d387f93adaaf26511ffdc3019b2d","head":{"label":"weedySeaDragon:sprint10-142716667-map-multiple-companies-without-locations","ref":"sprint10-142716667-map-multiple-companies-without-locations","sha":"1ab0b06776f9d387f93adaaf26511ffdc3019b2d","user":{"login":"weedySeaDragon","id":673794,"avatar_url":"https://avatars3.githubusercontent.com/u/673794?v=3","gravatar_id":"","url":"https://api.github.com/users/weedySeaDragon","html_url":"https://github.com/weedySeaDragon","followers_url":"https://api.github.com/users/weedySeaDragon/followers","following_url":"https://api.github.com/users/weedySeaDragon/following{/other_user}","gists_url":"https://api.github.com/users/weedySeaDragon/gists{/gist_id}","starred_url":"https://api.github.com/users/weedySeaDragon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/weedySeaDragon/subscriptions","organizations_url":"https://api.github.com/users/weedySeaDragon/orgs","repos_url":"https://api.github.com/users/weedySeaDragon/repos","events_url":"https://api.github.com/users/weedySeaDragon/events{/privacy}","received_events_url":"https://api.github.com/users/weedySeaDragon/received_events","type":"User","site_admin":false},"repo":{"id":72142277,"name":"shf-project","full_name":"weedySeaDragon/shf-project","owner":{"login":"weedySeaDragon","id":673794,"avatar_url":"https://avatars3.githubusercontent.com/u/673794?v=3","gravatar_id":"","url":"https://api.github.com/users/weedySeaDragon","html_url":"https://github.com/weedySeaDragon","followers_url":"https://api.github.com/users/weedySeaDragon/followers","following_url":"https://api.github.com/users/weedySeaDragon/following{/other_user}","gists_url":"https://api.github.com/users/weedySeaDragon/gists{/gist_id}","starred_url":"https://api.github.com/users/weedySeaDragon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/weedySeaDragon/subscriptions","organizations_url":"https://api.github.com/users/weedySeaDragon/orgs","repos_url":"https://api.github.com/users/weedySeaDragon/repos","events_url":"https://api.github.com/users/weedySeaDragon/events{/privacy}","received_events_url":"https://api.github.com/users/weedySeaDragon/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/weedySeaDragon/shf-project","description":null,"fork":true,"url":"https://api.github.com/repos/weedySeaDragon/shf-project","forks_url":"https://api.github.com/repos/weedySeaDragon/shf-project/forks","keys_url":"https://api.github.com/repos/weedySeaDragon/shf-project/keys{/key_id}","collaborators_url":"https://api.github.com/repos/weedySeaDragon/shf-project/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/weedySeaDragon/shf-project/teams","hooks_url":"https://api.github.com/repos/weedySeaDragon/shf-project/hooks","issue_events_url":"https://api.github.com/repos/weedySeaDragon/shf-project/issues/events{/number}","events_url":"https://api.github.com/repos/weedySeaDragon/shf-project/events","assignees_url":"https://api.github.com/repos/weedySeaDragon/shf-project/assignees{/user}","branches_url":"https://api.github.com/repos/weedySeaDragon/shf-project/branches{/branch}","tags_url":"https://api.github.com/repos/weedySeaDragon/shf-project/tags","blobs_url":"https://api.github.com/repos/weedySeaDragon/shf-project/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/weedySeaDragon/shf-project/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/weedySeaDragon/shf-project/git/refs{/sha}","trees_url":"https://api.github.com/repos/weedySeaDragon/shf-project/git/trees{/sha}","statuses_url":"https://api.github.com/repos/weedySeaDragon/shf-project/statuses/{sha}","languages_url":"https://api.github.com/repos/weedySeaDragon/shf-project/languages","stargazers_url":"https://api.github.com/repos/weedySeaDragon/shf-project/stargazers","contributors_url":"https://api.github.com/repos/weedySeaDragon/shf-project/contributors","subscribers_url":"https://api.github.com/repos/weedySeaDragon/shf-project/subscribers","subscription_url":"https://api.github.com/repos/weedySeaDragon/shf-project/subscription","commits_url":"https://api.github.com/repos/weedySeaDragon/shf-project/commits{/sha}","git_commits_url":"https://api.github.com/repos/weedySeaDragon/shf-project/git/commits{/sha}","comments_url":"https://api.github.com/repos/weedySeaDragon/shf-project/comments{/number}","issue_comment_url":"https://api.github.com/repos/weedySeaDragon/shf-project/issues/comments{/number}","contents_url":"https://api.github.com/repos/weedySeaDragon/shf-project/contents/{+path}","compare_url":"https://api.github.com/repos/weedySeaDragon/shf-project/compare/{base}...{head}","merges_url":"https://api.github.com/repos/weedySeaDragon/shf-project/merges","archive_url":"https://api.github.com/repos/weedySeaDragon/shf-project/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/weedySeaDragon/shf-project/downloads","issues_url":"https://api.github.com/repos/weedySeaDragon/shf-project/issues{/number}","pulls_url":"https://api.github.com/repos/weedySeaDragon/shf-project/pulls{/number}","milestones_url":"https://api.github.com/repos/weedySeaDragon/shf-project/milestones{/number}","notifications_url":"https://api.github.com/repos/weedySeaDragon/shf-project/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/weedySeaDragon/shf-project/labels{/name}","releases_url":"https://api.github.com/repos/weedySeaDragon/shf-project/releases{/id}","deployments_url":"https://api.github.com/repos/weedySeaDragon/shf-project/deployments","created_at":"2016-10-27T19:44:01Z","updated_at":"2017-02-06T19:31:28Z","pushed_at":"2017-03-30T01:30:50Z","git_url":"git://github.com/weedySeaDragon/shf-project.git","ssh_url":"git@github.com:weedySeaDragon/shf-project.git","clone_url":"https://github.com/weedySeaDragon/shf-project.git","svn_url":"https://github.com/weedySeaDragon/shf-project","homepage":null,"size":23789,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"AgileVentures:develop","ref":"develop","sha":"41da52dbdf1e3632de6b71c899abe3b87158dc2d","user":{"login":"AgileVentures","id":5116968,"avatar_url":"https://avatars3.githubusercontent.com/u/5116968?v=3","gravatar_id":"","url":"https://api.github.com/users/AgileVentures","html_url":"https://github.com/AgileVentures","followers_url":"https://api.github.com/users/AgileVentures/followers","following_url":"https://api.github.com/users/AgileVentures/following{/other_user}","gists_url":"https://api.github.com/users/AgileVentures/gists{/gist_id}","starred_url":"https://api.github.com/users/AgileVentures/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AgileVentures/subscriptions","organizations_url":"https://api.github.com/users/AgileVentures/orgs","repos_url":"https://api.github.com/users/AgileVentures/repos","events_url":"https://api.github.com/users/AgileVentures/events{/privacy}","received_events_url":"https://api.github.com/users/AgileVentures/received_events","type":"Organization","site_admin":false},"repo":{"id":71157737,"name":"shf-project","full_name":"AgileVentures/shf-project","owner":{"login":"AgileVentures","id":5116968,"avatar_url":"https://avatars3.githubusercontent.com/u/5116968?v=3","gravatar_id":"","url":"https://api.github.com/users/AgileVentures","html_url":"https://github.com/AgileVentures","followers_url":"https://api.github.com/users/AgileVentures/followers","following_url":"https://api.github.com/users/AgileVentures/following{/other_user}","gists_url":"https://api.github.com/users/AgileVentures/gists{/gist_id}","starred_url":"https://api.github.com/users/AgileVentures/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AgileVentures/subscriptions","organizations_url":"https://api.github.com/users/AgileVentures/orgs","repos_url":"https://api.github.com/users/AgileVentures/repos","events_url":"https://api.github.com/users/AgileVentures/events{/privacy}","received_events_url":"https://api.github.com/users/AgileVentures/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/AgileVentures/shf-project","description":null,"fork":true,"url":"https://api.github.com/repos/AgileVentures/shf-project","forks_url":"https://api.github.com/repos/AgileVentures/shf-project/forks","keys_url":"https://api.github.com/repos/AgileVentures/shf-project/keys{/key_id}","collaborators_url":"https://api.github.com/repos/AgileVentures/shf-project/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/AgileVentures/shf-project/teams","hooks_url":"https://api.github.com/repos/AgileVentures/shf-project/hooks","issue_events_url":"https://api.github.com/repos/AgileVentures/shf-project/issues/events{/number}","events_url":"https://api.github.com/repos/AgileVentures/shf-project/events","assignees_url":"https://api.github.com/repos/AgileVentures/shf-project/assignees{/user}","branches_url":"https://api.github.com/repos/AgileVentures/shf-project/branches{/branch}","tags_url":"https://api.github.com/repos/AgileVentures/shf-project/tags","blobs_url":"https://api.github.com/repos/AgileVentures/shf-project/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/AgileVentures/shf-project/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/AgileVentures/shf-project/git/refs{/sha}","trees_url":"https://api.github.com/repos/AgileVentures/shf-project/git/trees{/sha}","statuses_url":"https://api.github.com/repos/AgileVentures/shf-project/statuses/{sha}","languages_url":"https://api.github.com/repos/AgileVentures/shf-project/languages","stargazers_url":"https://api.github.com/repos/AgileVentures/shf-project/stargazers","contributors_url":"https://api.github.com/repos/AgileVentures/shf-project/contributors","subscribers_url":"https://api.github.com/repos/AgileVentures/shf-project/subscribers","subscription_url":"https://api.github.com/repos/AgileVentures/shf-project/subscription","commits_url":"https://api.github.com/repos/AgileVentures/shf-project/commits{/sha}","git_commits_url":"https://api.github.com/repos/AgileVentures/shf-project/git/commits{/sha}","comments_url":"https://api.github.com/repos/AgileVentures/shf-project/comments{/number}","issue_comment_url":"https://api.github.com/repos/AgileVentures/shf-project/issues/comments{/number}","contents_url":"https://api.github.com/repos/AgileVentures/shf-project/contents/{+path}","compare_url":"https://api.github.com/repos/AgileVentures/shf-project/compare/{base}...{head}","merges_url":"https://api.github.com/repos/AgileVentures/shf-project/merges","archive_url":"https://api.github.com/repos/AgileVentures/shf-project/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/AgileVentures/shf-project/downloads","issues_url":"https://api.github.com/repos/AgileVentures/shf-project/issues{/number}","pulls_url":"https://api.github.com/repos/AgileVentures/shf-project/pulls{/number}","milestones_url":"https://api.github.com/repos/AgileVentures/shf-project/milestones{/number}","notifications_url":"https://api.github.com/repos/AgileVentures/shf-project/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/AgileVentures/shf-project/labels{/name}","releases_url":"https://api.github.com/repos/AgileVentures/shf-project/releases{/id}","deployments_url":"https://api.github.com/repos/AgileVentures/shf-project/deployments","created_at":"2016-10-17T16:18:10Z","updated_at":"2016-12-02T13:34:05Z","pushed_at":"2017-03-29T19:18:15Z","git_url":"git://github.com/AgileVentures/shf-project.git","ssh_url":"git@github.com:AgileVentures/shf-project.git","clone_url":"https://github.com/AgileVentures/shf-project.git","svn_url":"https://github.com/AgileVentures/shf-project","homepage":null,"size":22645,"stargazers_count":1,"watchers_count":1,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":10,"mirror_url":null,"open_issues_count":2,"forks":10,"open_issues":2,"watchers":1,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/AgileVentures/shf-project/pulls/201"},"html":{"href":"https://github.com/AgileVentures/shf-project/pull/201"},"issue":{"href":"https://api.github.com/repos/AgileVentures/shf-project/issues/201"},"comments":{"href":"https://api.github.com/repos/AgileVentures/shf-project/issues/201/comments"},"review_comments":{"href":"https://api.github.com/repos/AgileVentures/shf-project/pulls/201/comments"},"review_comment":{"href":"https://api.github.com/repos/AgileVentures/shf-project/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/AgileVentures/shf-project/pulls/201/commits"},"statuses":{"href":"https://api.github.com/repos/AgileVentures/shf-project/statuses/1ab0b06776f9d387f93adaaf26511ffdc3019b2d"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"maintainer_can_modify":true,"commits":6,"additions":272,"deletions":3,"changed_files":7}}
{"actor":{"display_login":"weedySeaDragon"}}