{"action":"created","comment":{"url":"https://api.github.com/repos/crossroads/api.goodcity/pulls/comments/106101918","pull_request_review_id":27007887,"id":106101918,"diff_hunk":"@@ -12,7 +12,6 @@ class OrganisationPopulator\n \n     def initialize\n       @organisation_type = get_organisation_type\n-      @country           = Country.find_by_name_en(COUNTRY_NAME_EN)","path":"lib/goodcity/organisation_populator.rb","position":null,"original_position":4,"commit_id":"d516b0039dda5556a5093308000a7835d61d1717","original_commit_id":"d06bb54eea765b54e61b29d0bbae5d41a2db1a4f","user":{"login":"steveyken","id":149198,"avatar_url":"https://avatars0.githubusercontent.com/u/149198?v=3","gravatar_id":"","url":"https://api.github.com/users/steveyken","html_url":"https://github.com/steveyken","followers_url":"https://api.github.com/users/steveyken/followers","following_url":"https://api.github.com/users/steveyken/following{/other_user}","gists_url":"https://api.github.com/users/steveyken/gists{/gist_id}","starred_url":"https://api.github.com/users/steveyken/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/steveyken/subscriptions","organizations_url":"https://api.github.com/users/steveyken/orgs","repos_url":"https://api.github.com/users/steveyken/repos","events_url":"https://api.github.com/users/steveyken/events{/privacy}","received_events_url":"https://api.github.com/users/steveyken/received_events","type":"User","site_admin":false},"body":"@trojanh In general, the initialize function shouldn't be used to do any 'work' e.g. database calls, http lookups, file loads etc. It should be just enough code to return a new class that hasn't done anything yet but is in a ready and consistent state to be called. E.g. imagine if we added another top level method to count the number of organisations that exist, we wouldn't need to find the country or load the URL just to do this so it would be extra unnecessary work when calling initialize.","created_at":"2017-03-15T07:47:27Z","updated_at":"2017-03-15T07:47:27Z","html_url":"https://github.com/crossroads/api.goodcity/pull/272#discussion_r106101918","pull_request_url":"https://api.github.com/repos/crossroads/api.goodcity/pulls/272","_links":{"self":{"href":"https://api.github.com/repos/crossroads/api.goodcity/pulls/comments/106101918"},"html":{"href":"https://github.com/crossroads/api.goodcity/pull/272#discussion_r106101918"},"pull_request":{"href":"https://api.github.com/repos/crossroads/api.goodcity/pulls/272"}}},"pull_request":{"url":"https://api.github.com/repos/crossroads/api.goodcity/pulls/272","id":109854362,"html_url":"https://github.com/crossroads/api.goodcity/pull/272","diff_url":"https://github.com/crossroads/api.goodcity/pull/272.diff","patch_url":"https://github.com/crossroads/api.goodcity/pull/272.patch","issue_url":"https://api.github.com/repos/crossroads/api.goodcity/issues/272","number":272,"state":"open","locked":false,"title":"Gcw 1463 populate organisation table from json data","user":{"login":"steveyken","id":149198,"avatar_url":"https://avatars0.githubusercontent.com/u/149198?v=3","gravatar_id":"","url":"https://api.github.com/users/steveyken","html_url":"https://github.com/steveyken","followers_url":"https://api.github.com/users/steveyken/followers","following_url":"https://api.github.com/users/steveyken/following{/other_user}","gists_url":"https://api.github.com/users/steveyken/gists{/gist_id}","starred_url":"https://api.github.com/users/steveyken/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/steveyken/subscriptions","organizations_url":"https://api.github.com/users/steveyken/orgs","repos_url":"https://api.github.com/users/steveyken/repos","events_url":"https://api.github.com/users/steveyken/events{/privacy}","received_events_url":"https://api.github.com/users/steveyken/received_events","type":"User","site_admin":false},"body":"@trojanh I have some time to review so doing this now","created_at":"2017-03-09T07:23:27Z","updated_at":"2017-03-15T07:47:27Z","closed_at":null,"merged_at":null,"merge_commit_sha":"77315d88e78dcc4641370cf79fd157353d03d525","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/crossroads/api.goodcity/pulls/272/commits","review_comments_url":"https://api.github.com/repos/crossroads/api.goodcity/pulls/272/comments","review_comment_url":"https://api.github.com/repos/crossroads/api.goodcity/pulls/comments{/number}","comments_url":"https://api.github.com/repos/crossroads/api.goodcity/issues/272/comments","statuses_url":"https://api.github.com/repos/crossroads/api.goodcity/statuses/d516b0039dda5556a5093308000a7835d61d1717","head":{"label":"crossroads:GCW-1463-populate-organisation-table-from-json-data","ref":"GCW-1463-populate-organisation-table-from-json-data","sha":"d516b0039dda5556a5093308000a7835d61d1717","user":{"login":"crossroads","id":141971,"avatar_url":"https://avatars3.githubusercontent.com/u/141971?v=3","gravatar_id":"","url":"https://api.github.com/users/crossroads","html_url":"https://github.com/crossroads","followers_url":"https://api.github.com/users/crossroads/followers","following_url":"https://api.github.com/users/crossroads/following{/other_user}","gists_url":"https://api.github.com/users/crossroads/gists{/gist_id}","starred_url":"https://api.github.com/users/crossroads/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crossroads/subscriptions","organizations_url":"https://api.github.com/users/crossroads/orgs","repos_url":"https://api.github.com/users/crossroads/repos","events_url":"https://api.github.com/users/crossroads/events{/privacy}","received_events_url":"https://api.github.com/users/crossroads/received_events","type":"Organization","site_admin":false},"repo":{"id":21196107,"name":"api.goodcity","full_name":"crossroads/api.goodcity","owner":{"login":"crossroads","id":141971,"avatar_url":"https://avatars3.githubusercontent.com/u/141971?v=3","gravatar_id":"","url":"https://api.github.com/users/crossroads","html_url":"https://github.com/crossroads","followers_url":"https://api.github.com/users/crossroads/followers","following_url":"https://api.github.com/users/crossroads/following{/other_user}","gists_url":"https://api.github.com/users/crossroads/gists{/gist_id}","starred_url":"https://api.github.com/users/crossroads/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crossroads/subscriptions","organizations_url":"https://api.github.com/users/crossroads/orgs","repos_url":"https://api.github.com/users/crossroads/repos","events_url":"https://api.github.com/users/crossroads/events{/privacy}","received_events_url":"https://api.github.com/users/crossroads/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/crossroads/api.goodcity","description":"Good City API server","fork":false,"url":"https://api.github.com/repos/crossroads/api.goodcity","forks_url":"https://api.github.com/repos/crossroads/api.goodcity/forks","keys_url":"https://api.github.com/repos/crossroads/api.goodcity/keys{/key_id}","collaborators_url":"https://api.github.com/repos/crossroads/api.goodcity/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/crossroads/api.goodcity/teams","hooks_url":"https://api.github.com/repos/crossroads/api.goodcity/hooks","issue_events_url":"https://api.github.com/repos/crossroads/api.goodcity/issues/events{/number}","events_url":"https://api.github.com/repos/crossroads/api.goodcity/events","assignees_url":"https://api.github.com/repos/crossroads/api.goodcity/assignees{/user}","branches_url":"https://api.github.com/repos/crossroads/api.goodcity/branches{/branch}","tags_url":"https://api.github.com/repos/crossroads/api.goodcity/tags","blobs_url":"https://api.github.com/repos/crossroads/api.goodcity/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/crossroads/api.goodcity/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/crossroads/api.goodcity/git/refs{/sha}","trees_url":"https://api.github.com/repos/crossroads/api.goodcity/git/trees{/sha}","statuses_url":"https://api.github.com/repos/crossroads/api.goodcity/statuses/{sha}","languages_url":"https://api.github.com/repos/crossroads/api.goodcity/languages","stargazers_url":"https://api.github.com/repos/crossroads/api.goodcity/stargazers","contributors_url":"https://api.github.com/repos/crossroads/api.goodcity/contributors","subscribers_url":"https://api.github.com/repos/crossroads/api.goodcity/subscribers","subscription_url":"https://api.github.com/repos/crossroads/api.goodcity/subscription","commits_url":"https://api.github.com/repos/crossroads/api.goodcity/commits{/sha}","git_commits_url":"https://api.github.com/repos/crossroads/api.goodcity/git/commits{/sha}","comments_url":"https://api.github.com/repos/crossroads/api.goodcity/comments{/number}","issue_comment_url":"https://api.github.com/repos/crossroads/api.goodcity/issues/comments{/number}","contents_url":"https://api.github.com/repos/crossroads/api.goodcity/contents/{+path}","compare_url":"https://api.github.com/repos/crossroads/api.goodcity/compare/{base}...{head}","merges_url":"https://api.github.com/repos/crossroads/api.goodcity/merges","archive_url":"https://api.github.com/repos/crossroads/api.goodcity/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/crossroads/api.goodcity/downloads","issues_url":"https://api.github.com/repos/crossroads/api.goodcity/issues{/number}","pulls_url":"https://api.github.com/repos/crossroads/api.goodcity/pulls{/number}","milestones_url":"https://api.github.com/repos/crossroads/api.goodcity/milestones{/number}","notifications_url":"https://api.github.com/repos/crossroads/api.goodcity/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/crossroads/api.goodcity/labels{/name}","releases_url":"https://api.github.com/repos/crossroads/api.goodcity/releases{/id}","deployments_url":"https://api.github.com/repos/crossroads/api.goodcity/deployments","created_at":"2014-06-25T08:40:40Z","updated_at":"2017-02-14T17:53:05Z","pushed_at":"2017-03-15T07:38:45Z","git_url":"git://github.com/crossroads/api.goodcity.git","ssh_url":"git@github.com:crossroads/api.goodcity.git","clone_url":"https://github.com/crossroads/api.goodcity.git","svn_url":"https://github.com/crossroads/api.goodcity","homepage":"http://api.goodcity.hk","size":3844,"stargazers_count":4,"watchers_count":4,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":1,"forks":2,"open_issues":1,"watchers":4,"default_branch":"master"}},"base":{"label":"crossroads:master","ref":"master","sha":"0ee8c3ca70d53aa73d3f17d313d9244479f55812","user":{"login":"crossroads","id":141971,"avatar_url":"https://avatars3.githubusercontent.com/u/141971?v=3","gravatar_id":"","url":"https://api.github.com/users/crossroads","html_url":"https://github.com/crossroads","followers_url":"https://api.github.com/users/crossroads/followers","following_url":"https://api.github.com/users/crossroads/following{/other_user}","gists_url":"https://api.github.com/users/crossroads/gists{/gist_id}","starred_url":"https://api.github.com/users/crossroads/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crossroads/subscriptions","organizations_url":"https://api.github.com/users/crossroads/orgs","repos_url":"https://api.github.com/users/crossroads/repos","events_url":"https://api.github.com/users/crossroads/events{/privacy}","received_events_url":"https://api.github.com/users/crossroads/received_events","type":"Organization","site_admin":false},"repo":{"id":21196107,"name":"api.goodcity","full_name":"crossroads/api.goodcity","owner":{"login":"crossroads","id":141971,"avatar_url":"https://avatars3.githubusercontent.com/u/141971?v=3","gravatar_id":"","url":"https://api.github.com/users/crossroads","html_url":"https://github.com/crossroads","followers_url":"https://api.github.com/users/crossroads/followers","following_url":"https://api.github.com/users/crossroads/following{/other_user}","gists_url":"https://api.github.com/users/crossroads/gists{/gist_id}","starred_url":"https://api.github.com/users/crossroads/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crossroads/subscriptions","organizations_url":"https://api.github.com/users/crossroads/orgs","repos_url":"https://api.github.com/users/crossroads/repos","events_url":"https://api.github.com/users/crossroads/events{/privacy}","received_events_url":"https://api.github.com/users/crossroads/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/crossroads/api.goodcity","description":"Good City API server","fork":false,"url":"https://api.github.com/repos/crossroads/api.goodcity","forks_url":"https://api.github.com/repos/crossroads/api.goodcity/forks","keys_url":"https://api.github.com/repos/crossroads/api.goodcity/keys{/key_id}","collaborators_url":"https://api.github.com/repos/crossroads/api.goodcity/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/crossroads/api.goodcity/teams","hooks_url":"https://api.github.com/repos/crossroads/api.goodcity/hooks","issue_events_url":"https://api.github.com/repos/crossroads/api.goodcity/issues/events{/number}","events_url":"https://api.github.com/repos/crossroads/api.goodcity/events","assignees_url":"https://api.github.com/repos/crossroads/api.goodcity/assignees{/user}","branches_url":"https://api.github.com/repos/crossroads/api.goodcity/branches{/branch}","tags_url":"https://api.github.com/repos/crossroads/api.goodcity/tags","blobs_url":"https://api.github.com/repos/crossroads/api.goodcity/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/crossroads/api.goodcity/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/crossroads/api.goodcity/git/refs{/sha}","trees_url":"https://api.github.com/repos/crossroads/api.goodcity/git/trees{/sha}","statuses_url":"https://api.github.com/repos/crossroads/api.goodcity/statuses/{sha}","languages_url":"https://api.github.com/repos/crossroads/api.goodcity/languages","stargazers_url":"https://api.github.com/repos/crossroads/api.goodcity/stargazers","contributors_url":"https://api.github.com/repos/crossroads/api.goodcity/contributors","subscribers_url":"https://api.github.com/repos/crossroads/api.goodcity/subscribers","subscription_url":"https://api.github.com/repos/crossroads/api.goodcity/subscription","commits_url":"https://api.github.com/repos/crossroads/api.goodcity/commits{/sha}","git_commits_url":"https://api.github.com/repos/crossroads/api.goodcity/git/commits{/sha}","comments_url":"https://api.github.com/repos/crossroads/api.goodcity/comments{/number}","issue_comment_url":"https://api.github.com/repos/crossroads/api.goodcity/issues/comments{/number}","contents_url":"https://api.github.com/repos/crossroads/api.goodcity/contents/{+path}","compare_url":"https://api.github.com/repos/crossroads/api.goodcity/compare/{base}...{head}","merges_url":"https://api.github.com/repos/crossroads/api.goodcity/merges","archive_url":"https://api.github.com/repos/crossroads/api.goodcity/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/crossroads/api.goodcity/downloads","issues_url":"https://api.github.com/repos/crossroads/api.goodcity/issues{/number}","pulls_url":"https://api.github.com/repos/crossroads/api.goodcity/pulls{/number}","milestones_url":"https://api.github.com/repos/crossroads/api.goodcity/milestones{/number}","notifications_url":"https://api.github.com/repos/crossroads/api.goodcity/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/crossroads/api.goodcity/labels{/name}","releases_url":"https://api.github.com/repos/crossroads/api.goodcity/releases{/id}","deployments_url":"https://api.github.com/repos/crossroads/api.goodcity/deployments","created_at":"2014-06-25T08:40:40Z","updated_at":"2017-02-14T17:53:05Z","pushed_at":"2017-03-15T07:38:45Z","git_url":"git://github.com/crossroads/api.goodcity.git","ssh_url":"git@github.com:crossroads/api.goodcity.git","clone_url":"https://github.com/crossroads/api.goodcity.git","svn_url":"https://github.com/crossroads/api.goodcity","homepage":"http://api.goodcity.hk","size":3844,"stargazers_count":4,"watchers_count":4,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":1,"forks":2,"open_issues":1,"watchers":4,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/crossroads/api.goodcity/pulls/272"},"html":{"href":"https://github.com/crossroads/api.goodcity/pull/272"},"issue":{"href":"https://api.github.com/repos/crossroads/api.goodcity/issues/272"},"comments":{"href":"https://api.github.com/repos/crossroads/api.goodcity/issues/272/comments"},"review_comments":{"href":"https://api.github.com/repos/crossroads/api.goodcity/pulls/272/comments"},"review_comment":{"href":"https://api.github.com/repos/crossroads/api.goodcity/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/crossroads/api.goodcity/pulls/272/commits"},"statuses":{"href":"https://api.github.com/repos/crossroads/api.goodcity/statuses/d516b0039dda5556a5093308000a7835d61d1717"}}}}
{"actor":{"display_login":"steveyken"}}