{"action":"created","comment":{"url":"https://api.github.com/repos/datagovuk/publish_data_beta/pulls/comments/153555212","pull_request_review_id":79577653,"id":153555212,"diff_hunk":"@@ -1,47 +1,29 @@\n require 'base64'\n \n-CONFIG_PATH = Rails.root.join('config', 'elasticsearch.yml')\n-TEMPLATE = ERB.new File.new(CONFIG_PATH).read\n-\n-begin\n-  ELASTIC_CONFIG = YAML.load(TEMPLATE.result(binding))[ENV['RAILS_ENV']]\n-rescue => e\n-  Rails.logger.fatal \"Failed to parse elasticsearch yaml configuration. Exiting\"\n-  Rails.logger.fatal e\n-  exit\n+def config\n+  return es_config_from_host if elastic_config['host'].present?","path":"config/initializers/elasticsearch.rb","position":13,"original_position":13,"commit_id":"2664225374491b4505a21c32ce0f37c54665ba93","original_commit_id":"2664225374491b4505a21c32ce0f37c54665ba93","user":{"login":"TobyRet","id":5256922,"avatar_url":"https://avatars0.githubusercontent.com/u/5256922?v=4","gravatar_id":"","url":"https://api.github.com/users/TobyRet","html_url":"https://github.com/TobyRet","followers_url":"https://api.github.com/users/TobyRet/followers","following_url":"https://api.github.com/users/TobyRet/following{/other_user}","gists_url":"https://api.github.com/users/TobyRet/gists{/gist_id}","starred_url":"https://api.github.com/users/TobyRet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TobyRet/subscriptions","organizations_url":"https://api.github.com/users/TobyRet/orgs","repos_url":"https://api.github.com/users/TobyRet/repos","events_url":"https://api.github.com/users/TobyRet/events{/privacy}","received_events_url":"https://api.github.com/users/TobyRet/received_events","type":"User","site_admin":false},"body":"Would memoization be useful when calling elastic_config?","created_at":"2017-11-28T16:54:32Z","updated_at":"2017-11-28T16:54:32Z","html_url":"https://github.com/datagovuk/publish_data_beta/pull/455#discussion_r153555212","pull_request_url":"https://api.github.com/repos/datagovuk/publish_data_beta/pulls/455","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/datagovuk/publish_data_beta/pulls/comments/153555212"},"html":{"href":"https://github.com/datagovuk/publish_data_beta/pull/455#discussion_r153555212"},"pull_request":{"href":"https://api.github.com/repos/datagovuk/publish_data_beta/pulls/455"}}},"pull_request":{"url":"https://api.github.com/repos/datagovuk/publish_data_beta/pulls/455","id":155114834,"html_url":"https://github.com/datagovuk/publish_data_beta/pull/455","diff_url":"https://github.com/datagovuk/publish_data_beta/pull/455.diff","patch_url":"https://github.com/datagovuk/publish_data_beta/pull/455.patch","issue_url":"https://api.github.com/repos/datagovuk/publish_data_beta/issues/455","number":455,"state":"open","locked":false,"title":"Refactor ES initializer","user":{"login":"laurentqro","id":3141541,"avatar_url":"https://avatars3.githubusercontent.com/u/3141541?v=4","gravatar_id":"","url":"https://api.github.com/users/laurentqro","html_url":"https://github.com/laurentqro","followers_url":"https://api.github.com/users/laurentqro/followers","following_url":"https://api.github.com/users/laurentqro/following{/other_user}","gists_url":"https://api.github.com/users/laurentqro/gists{/gist_id}","starred_url":"https://api.github.com/users/laurentqro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/laurentqro/subscriptions","organizations_url":"https://api.github.com/users/laurentqro/orgs","repos_url":"https://api.github.com/users/laurentqro/repos","events_url":"https://api.github.com/users/laurentqro/events{/privacy}","received_events_url":"https://api.github.com/users/laurentqro/received_events","type":"User","site_admin":false},"body":"☝️ ","created_at":"2017-11-28T16:11:28Z","updated_at":"2017-11-28T16:54:32Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0026b5b599cc250a84d9d2dc5e9c1ac83cc4bc1e","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/datagovuk/publish_data_beta/pulls/455/commits","review_comments_url":"https://api.github.com/repos/datagovuk/publish_data_beta/pulls/455/comments","review_comment_url":"https://api.github.com/repos/datagovuk/publish_data_beta/pulls/comments{/number}","comments_url":"https://api.github.com/repos/datagovuk/publish_data_beta/issues/455/comments","statuses_url":"https://api.github.com/repos/datagovuk/publish_data_beta/statuses/2664225374491b4505a21c32ce0f37c54665ba93","head":{"label":"datagovuk:laurent/es-init-fun","ref":"laurent/es-init-fun","sha":"2664225374491b4505a21c32ce0f37c54665ba93","user":{"login":"datagovuk","id":1893876,"avatar_url":"https://avatars0.githubusercontent.com/u/1893876?v=4","gravatar_id":"","url":"https://api.github.com/users/datagovuk","html_url":"https://github.com/datagovuk","followers_url":"https://api.github.com/users/datagovuk/followers","following_url":"https://api.github.com/users/datagovuk/following{/other_user}","gists_url":"https://api.github.com/users/datagovuk/gists{/gist_id}","starred_url":"https://api.github.com/users/datagovuk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/datagovuk/subscriptions","organizations_url":"https://api.github.com/users/datagovuk/orgs","repos_url":"https://api.github.com/users/datagovuk/repos","events_url":"https://api.github.com/users/datagovuk/events{/privacy}","received_events_url":"https://api.github.com/users/datagovuk/received_events","type":"Organization","site_admin":false},"repo":{"id":92948943,"name":"publish_data_beta","full_name":"datagovuk/publish_data_beta","owner":{"login":"datagovuk","id":1893876,"avatar_url":"https://avatars0.githubusercontent.com/u/1893876?v=4","gravatar_id":"","url":"https://api.github.com/users/datagovuk","html_url":"https://github.com/datagovuk","followers_url":"https://api.github.com/users/datagovuk/followers","following_url":"https://api.github.com/users/datagovuk/following{/other_user}","gists_url":"https://api.github.com/users/datagovuk/gists{/gist_id}","starred_url":"https://api.github.com/users/datagovuk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/datagovuk/subscriptions","organizations_url":"https://api.github.com/users/datagovuk/orgs","repos_url":"https://api.github.com/users/datagovuk/repos","events_url":"https://api.github.com/users/datagovuk/events{/privacy}","received_events_url":"https://api.github.com/users/datagovuk/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/datagovuk/publish_data_beta","description":"Beta version of publish data","fork":false,"url":"https://api.github.com/repos/datagovuk/publish_data_beta","forks_url":"https://api.github.com/repos/datagovuk/publish_data_beta/forks","keys_url":"https://api.github.com/repos/datagovuk/publish_data_beta/keys{/key_id}","collaborators_url":"https://api.github.com/repos/datagovuk/publish_data_beta/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/datagovuk/publish_data_beta/teams","hooks_url":"https://api.github.com/repos/datagovuk/publish_data_beta/hooks","issue_events_url":"https://api.github.com/repos/datagovuk/publish_data_beta/issues/events{/number}","events_url":"https://api.github.com/repos/datagovuk/publish_data_beta/events","assignees_url":"https://api.github.com/repos/datagovuk/publish_data_beta/assignees{/user}","branches_url":"https://api.github.com/repos/datagovuk/publish_data_beta/branches{/branch}","tags_url":"https://api.github.com/repos/datagovuk/publish_data_beta/tags","blobs_url":"https://api.github.com/repos/datagovuk/publish_data_beta/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/datagovuk/publish_data_beta/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/datagovuk/publish_data_beta/git/refs{/sha}","trees_url":"https://api.github.com/repos/datagovuk/publish_data_beta/git/trees{/sha}","statuses_url":"https://api.github.com/repos/datagovuk/publish_data_beta/statuses/{sha}","languages_url":"https://api.github.com/repos/datagovuk/publish_data_beta/languages","stargazers_url":"https://api.github.com/repos/datagovuk/publish_data_beta/stargazers","contributors_url":"https://api.github.com/repos/datagovuk/publish_data_beta/contributors","subscribers_url":"https://api.github.com/repos/datagovuk/publish_data_beta/subscribers","subscription_url":"https://api.github.com/repos/datagovuk/publish_data_beta/subscription","commits_url":"https://api.github.com/repos/datagovuk/publish_data_beta/commits{/sha}","git_commits_url":"https://api.github.com/repos/datagovuk/publish_data_beta/git/commits{/sha}","comments_url":"https://api.github.com/repos/datagovuk/publish_data_beta/comments{/number}","issue_comment_url":"https://api.github.com/repos/datagovuk/publish_data_beta/issues/comments{/number}","contents_url":"https://api.github.com/repos/datagovuk/publish_data_beta/contents/{+path}","compare_url":"https://api.github.com/repos/datagovuk/publish_data_beta/compare/{base}...{head}","merges_url":"https://api.github.com/repos/datagovuk/publish_data_beta/merges","archive_url":"https://api.github.com/repos/datagovuk/publish_data_beta/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/datagovuk/publish_data_beta/downloads","issues_url":"https://api.github.com/repos/datagovuk/publish_data_beta/issues{/number}","pulls_url":"https://api.github.com/repos/datagovuk/publish_data_beta/pulls{/number}","milestones_url":"https://api.github.com/repos/datagovuk/publish_data_beta/milestones{/number}","notifications_url":"https://api.github.com/repos/datagovuk/publish_data_beta/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/datagovuk/publish_data_beta/labels{/name}","releases_url":"https://api.github.com/repos/datagovuk/publish_data_beta/releases{/id}","deployments_url":"https://api.github.com/repos/datagovuk/publish_data_beta/deployments","created_at":"2017-05-31T13:33:20Z","updated_at":"2017-07-14T19:52:32Z","pushed_at":"2017-11-28T16:35:26Z","git_url":"git://github.com/datagovuk/publish_data_beta.git","ssh_url":"git@github.com:datagovuk/publish_data_beta.git","clone_url":"https://github.com/datagovuk/publish_data_beta.git","svn_url":"https://github.com/datagovuk/publish_data_beta","homepage":"","size":42507,"stargazers_count":2,"watchers_count":2,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":22,"forks":1,"open_issues":22,"watchers":2,"default_branch":"master"}},"base":{"label":"datagovuk:master","ref":"master","sha":"4169f368ed0b9c8db43b65cc5ff7b72cae4e6a0a","user":{"login":"datagovuk","id":1893876,"avatar_url":"https://avatars0.githubusercontent.com/u/1893876?v=4","gravatar_id":"","url":"https://api.github.com/users/datagovuk","html_url":"https://github.com/datagovuk","followers_url":"https://api.github.com/users/datagovuk/followers","following_url":"https://api.github.com/users/datagovuk/following{/other_user}","gists_url":"https://api.github.com/users/datagovuk/gists{/gist_id}","starred_url":"https://api.github.com/users/datagovuk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/datagovuk/subscriptions","organizations_url":"https://api.github.com/users/datagovuk/orgs","repos_url":"https://api.github.com/users/datagovuk/repos","events_url":"https://api.github.com/users/datagovuk/events{/privacy}","received_events_url":"https://api.github.com/users/datagovuk/received_events","type":"Organization","site_admin":false},"repo":{"id":92948943,"name":"publish_data_beta","full_name":"datagovuk/publish_data_beta","owner":{"login":"datagovuk","id":1893876,"avatar_url":"https://avatars0.githubusercontent.com/u/1893876?v=4","gravatar_id":"","url":"https://api.github.com/users/datagovuk","html_url":"https://github.com/datagovuk","followers_url":"https://api.github.com/users/datagovuk/followers","following_url":"https://api.github.com/users/datagovuk/following{/other_user}","gists_url":"https://api.github.com/users/datagovuk/gists{/gist_id}","starred_url":"https://api.github.com/users/datagovuk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/datagovuk/subscriptions","organizations_url":"https://api.github.com/users/datagovuk/orgs","repos_url":"https://api.github.com/users/datagovuk/repos","events_url":"https://api.github.com/users/datagovuk/events{/privacy}","received_events_url":"https://api.github.com/users/datagovuk/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/datagovuk/publish_data_beta","description":"Beta version of publish data","fork":false,"url":"https://api.github.com/repos/datagovuk/publish_data_beta","forks_url":"https://api.github.com/repos/datagovuk/publish_data_beta/forks","keys_url":"https://api.github.com/repos/datagovuk/publish_data_beta/keys{/key_id}","collaborators_url":"https://api.github.com/repos/datagovuk/publish_data_beta/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/datagovuk/publish_data_beta/teams","hooks_url":"https://api.github.com/repos/datagovuk/publish_data_beta/hooks","issue_events_url":"https://api.github.com/repos/datagovuk/publish_data_beta/issues/events{/number}","events_url":"https://api.github.com/repos/datagovuk/publish_data_beta/events","assignees_url":"https://api.github.com/repos/datagovuk/publish_data_beta/assignees{/user}","branches_url":"https://api.github.com/repos/datagovuk/publish_data_beta/branches{/branch}","tags_url":"https://api.github.com/repos/datagovuk/publish_data_beta/tags","blobs_url":"https://api.github.com/repos/datagovuk/publish_data_beta/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/datagovuk/publish_data_beta/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/datagovuk/publish_data_beta/git/refs{/sha}","trees_url":"https://api.github.com/repos/datagovuk/publish_data_beta/git/trees{/sha}","statuses_url":"https://api.github.com/repos/datagovuk/publish_data_beta/statuses/{sha}","languages_url":"https://api.github.com/repos/datagovuk/publish_data_beta/languages","stargazers_url":"https://api.github.com/repos/datagovuk/publish_data_beta/stargazers","contributors_url":"https://api.github.com/repos/datagovuk/publish_data_beta/contributors","subscribers_url":"https://api.github.com/repos/datagovuk/publish_data_beta/subscribers","subscription_url":"https://api.github.com/repos/datagovuk/publish_data_beta/subscription","commits_url":"https://api.github.com/repos/datagovuk/publish_data_beta/commits{/sha}","git_commits_url":"https://api.github.com/repos/datagovuk/publish_data_beta/git/commits{/sha}","comments_url":"https://api.github.com/repos/datagovuk/publish_data_beta/comments{/number}","issue_comment_url":"https://api.github.com/repos/datagovuk/publish_data_beta/issues/comments{/number}","contents_url":"https://api.github.com/repos/datagovuk/publish_data_beta/contents/{+path}","compare_url":"https://api.github.com/repos/datagovuk/publish_data_beta/compare/{base}...{head}","merges_url":"https://api.github.com/repos/datagovuk/publish_data_beta/merges","archive_url":"https://api.github.com/repos/datagovuk/publish_data_beta/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/datagovuk/publish_data_beta/downloads","issues_url":"https://api.github.com/repos/datagovuk/publish_data_beta/issues{/number}","pulls_url":"https://api.github.com/repos/datagovuk/publish_data_beta/pulls{/number}","milestones_url":"https://api.github.com/repos/datagovuk/publish_data_beta/milestones{/number}","notifications_url":"https://api.github.com/repos/datagovuk/publish_data_beta/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/datagovuk/publish_data_beta/labels{/name}","releases_url":"https://api.github.com/repos/datagovuk/publish_data_beta/releases{/id}","deployments_url":"https://api.github.com/repos/datagovuk/publish_data_beta/deployments","created_at":"2017-05-31T13:33:20Z","updated_at":"2017-07-14T19:52:32Z","pushed_at":"2017-11-28T16:35:26Z","git_url":"git://github.com/datagovuk/publish_data_beta.git","ssh_url":"git@github.com:datagovuk/publish_data_beta.git","clone_url":"https://github.com/datagovuk/publish_data_beta.git","svn_url":"https://github.com/datagovuk/publish_data_beta","homepage":"","size":42507,"stargazers_count":2,"watchers_count":2,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":22,"forks":1,"open_issues":22,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/datagovuk/publish_data_beta/pulls/455"},"html":{"href":"https://github.com/datagovuk/publish_data_beta/pull/455"},"issue":{"href":"https://api.github.com/repos/datagovuk/publish_data_beta/issues/455"},"comments":{"href":"https://api.github.com/repos/datagovuk/publish_data_beta/issues/455/comments"},"review_comments":{"href":"https://api.github.com/repos/datagovuk/publish_data_beta/pulls/455/comments"},"review_comment":{"href":"https://api.github.com/repos/datagovuk/publish_data_beta/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/datagovuk/publish_data_beta/pulls/455/commits"},"statuses":{"href":"https://api.github.com/repos/datagovuk/publish_data_beta/statuses/2664225374491b4505a21c32ce0f37c54665ba93"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"TobyRet"}}