{"action":"created","comment":{"url":"https://api.github.com/repos/DigitalNZ/contentful-redis/pulls/comments/219367287","pull_request_review_id":157504553,"id":219367287,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxOTM2NzI4Nw==","diff_hunk":"@@ -0,0 +1,138 @@\n+# frozen_string_literal: true\n+\n+require_relative 'asset'\n+require_relative 'request'\n+require_relative 'key_manager'\n+require_relative 'error'\n+require_relative 'class_finder'\n+\n+# Base class for contentful redis intergation.\n+module ContentfulRedis\n+  class ModelBase\n+    class << self\n+      def find(id, env = ContentfulRedis.configuration.default_env || :published)\n+        parameters = { 'sys.id': id, content_type: content_model }\n+\n+        new(ContentfulRedis::Request.new(space, parameters, :get, env).call)\n+      end\n+\n+      def find_by(args, env = ContentfulRedis.configuration.default_env || :published)\n+        raise ContentfulRedis::Error::ArgumentError, \"#{args} contain fields which are not a decleared as a searchable fields\" unless (args.keys - searchable_fields).empty?","path":"lib/contentful_redis/model_base.rb","position":20,"original_position":20,"commit_id":"a7856604d9abc6b70584931aeeed3cc1d302ca93","original_commit_id":"a7856604d9abc6b70584931aeeed3cc1d302ca93","user":{"login":"Reinkaos","id":1848911,"node_id":"MDQ6VXNlcjE4NDg5MTE=","avatar_url":"https://avatars0.githubusercontent.com/u/1848911?v=4","gravatar_id":"","url":"https://api.github.com/users/Reinkaos","html_url":"https://github.com/Reinkaos","followers_url":"https://api.github.com/users/Reinkaos/followers","following_url":"https://api.github.com/users/Reinkaos/following{/other_user}","gists_url":"https://api.github.com/users/Reinkaos/gists{/gist_id}","starred_url":"https://api.github.com/users/Reinkaos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Reinkaos/subscriptions","organizations_url":"https://api.github.com/users/Reinkaos/orgs","repos_url":"https://api.github.com/users/Reinkaos/repos","events_url":"https://api.github.com/users/Reinkaos/events{/privacy}","received_events_url":"https://api.github.com/users/Reinkaos/received_events","type":"User","site_admin":false},"body":"declared**","created_at":"2018-09-21T02:14:29Z","updated_at":"2018-09-21T02:18:53Z","html_url":"https://github.com/DigitalNZ/contentful-redis/pull/1#discussion_r219367287","pull_request_url":"https://api.github.com/repos/DigitalNZ/contentful-redis/pulls/1","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/DigitalNZ/contentful-redis/pulls/comments/219367287"},"html":{"href":"https://github.com/DigitalNZ/contentful-redis/pull/1#discussion_r219367287"},"pull_request":{"href":"https://api.github.com/repos/DigitalNZ/contentful-redis/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/DigitalNZ/contentful-redis/pulls/1","id":210631222,"node_id":"MDExOlB1bGxSZXF1ZXN0MjEwNjMxMjIy","html_url":"https://github.com/DigitalNZ/contentful-redis/pull/1","diff_url":"https://github.com/DigitalNZ/contentful-redis/pull/1.diff","patch_url":"https://github.com/DigitalNZ/contentful-redis/pull/1.patch","issue_url":"https://api.github.com/repos/DigitalNZ/contentful-redis/issues/1","number":1,"state":"open","locked":false,"title":"Close source migration","user":{"login":"DanHenton","id":7565646,"node_id":"MDQ6VXNlcjc1NjU2NDY=","avatar_url":"https://avatars2.githubusercontent.com/u/7565646?v=4","gravatar_id":"","url":"https://api.github.com/users/DanHenton","html_url":"https://github.com/DanHenton","followers_url":"https://api.github.com/users/DanHenton/followers","following_url":"https://api.github.com/users/DanHenton/following{/other_user}","gists_url":"https://api.github.com/users/DanHenton/gists{/gist_id}","starred_url":"https://api.github.com/users/DanHenton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DanHenton/subscriptions","organizations_url":"https://api.github.com/users/DanHenton/orgs","repos_url":"https://api.github.com/users/DanHenton/repos","events_url":"https://api.github.com/users/DanHenton/events{/privacy}","received_events_url":"https://api.github.com/users/DanHenton/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-08-24T03:38:54Z","updated_at":"2018-09-21T02:18:53Z","closed_at":null,"merged_at":null,"merge_commit_sha":"fb61b5f100dacd01993b58d0657a301e0da0fab9","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/DigitalNZ/contentful-redis/pulls/1/commits","review_comments_url":"https://api.github.com/repos/DigitalNZ/contentful-redis/pulls/1/comments","review_comment_url":"https://api.github.com/repos/DigitalNZ/contentful-redis/pulls/comments{/number}","comments_url":"https://api.github.com/repos/DigitalNZ/contentful-redis/issues/1/comments","statuses_url":"https://api.github.com/repos/DigitalNZ/contentful-redis/statuses/a7856604d9abc6b70584931aeeed3cc1d302ca93","head":{"label":"DigitalNZ:close-source-migration","ref":"close-source-migration","sha":"a7856604d9abc6b70584931aeeed3cc1d302ca93","user":{"login":"DigitalNZ","id":93386,"node_id":"MDEyOk9yZ2FuaXphdGlvbjkzMzg2","avatar_url":"https://avatars2.githubusercontent.com/u/93386?v=4","gravatar_id":"","url":"https://api.github.com/users/DigitalNZ","html_url":"https://github.com/DigitalNZ","followers_url":"https://api.github.com/users/DigitalNZ/followers","following_url":"https://api.github.com/users/DigitalNZ/following{/other_user}","gists_url":"https://api.github.com/users/DigitalNZ/gists{/gist_id}","starred_url":"https://api.github.com/users/DigitalNZ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DigitalNZ/subscriptions","organizations_url":"https://api.github.com/users/DigitalNZ/orgs","repos_url":"https://api.github.com/users/DigitalNZ/repos","events_url":"https://api.github.com/users/DigitalNZ/events{/privacy}","received_events_url":"https://api.github.com/users/DigitalNZ/received_events","type":"Organization","site_admin":false},"repo":{"id":145938503,"node_id":"MDEwOlJlcG9zaXRvcnkxNDU5Mzg1MDM=","name":"contentful-redis","full_name":"DigitalNZ/contentful-redis","private":false,"owner":{"login":"DigitalNZ","id":93386,"node_id":"MDEyOk9yZ2FuaXphdGlvbjkzMzg2","avatar_url":"https://avatars2.githubusercontent.com/u/93386?v=4","gravatar_id":"","url":"https://api.github.com/users/DigitalNZ","html_url":"https://github.com/DigitalNZ","followers_url":"https://api.github.com/users/DigitalNZ/followers","following_url":"https://api.github.com/users/DigitalNZ/following{/other_user}","gists_url":"https://api.github.com/users/DigitalNZ/gists{/gist_id}","starred_url":"https://api.github.com/users/DigitalNZ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DigitalNZ/subscriptions","organizations_url":"https://api.github.com/users/DigitalNZ/orgs","repos_url":"https://api.github.com/users/DigitalNZ/repos","events_url":"https://api.github.com/users/DigitalNZ/events{/privacy}","received_events_url":"https://api.github.com/users/DigitalNZ/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/DigitalNZ/contentful-redis","description":"Contentful CMS API caching using Redis","fork":false,"url":"https://api.github.com/repos/DigitalNZ/contentful-redis","forks_url":"https://api.github.com/repos/DigitalNZ/contentful-redis/forks","keys_url":"https://api.github.com/repos/DigitalNZ/contentful-redis/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DigitalNZ/contentful-redis/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DigitalNZ/contentful-redis/teams","hooks_url":"https://api.github.com/repos/DigitalNZ/contentful-redis/hooks","issue_events_url":"https://api.github.com/repos/DigitalNZ/contentful-redis/issues/events{/number}","events_url":"https://api.github.com/repos/DigitalNZ/contentful-redis/events","assignees_url":"https://api.github.com/repos/DigitalNZ/contentful-redis/assignees{/user}","branches_url":"https://api.github.com/repos/DigitalNZ/contentful-redis/branches{/branch}","tags_url":"https://api.github.com/repos/DigitalNZ/contentful-redis/tags","blobs_url":"https://api.github.com/repos/DigitalNZ/contentful-redis/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DigitalNZ/contentful-redis/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DigitalNZ/contentful-redis/git/refs{/sha}","trees_url":"https://api.github.com/repos/DigitalNZ/contentful-redis/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DigitalNZ/contentful-redis/statuses/{sha}","languages_url":"https://api.github.com/repos/DigitalNZ/contentful-redis/languages","stargazers_url":"https://api.github.com/repos/DigitalNZ/contentful-redis/stargazers","contributors_url":"https://api.github.com/repos/DigitalNZ/contentful-redis/contributors","subscribers_url":"https://api.github.com/repos/DigitalNZ/contentful-redis/subscribers","subscription_url":"https://api.github.com/repos/DigitalNZ/contentful-redis/subscription","commits_url":"https://api.github.com/repos/DigitalNZ/contentful-redis/commits{/sha}","git_commits_url":"https://api.github.com/repos/DigitalNZ/contentful-redis/git/commits{/sha}","comments_url":"https://api.github.com/repos/DigitalNZ/contentful-redis/comments{/number}","issue_comment_url":"https://api.github.com/repos/DigitalNZ/contentful-redis/issues/comments{/number}","contents_url":"https://api.github.com/repos/DigitalNZ/contentful-redis/contents/{+path}","compare_url":"https://api.github.com/repos/DigitalNZ/contentful-redis/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DigitalNZ/contentful-redis/merges","archive_url":"https://api.github.com/repos/DigitalNZ/contentful-redis/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DigitalNZ/contentful-redis/downloads","issues_url":"https://api.github.com/repos/DigitalNZ/contentful-redis/issues{/number}","pulls_url":"https://api.github.com/repos/DigitalNZ/contentful-redis/pulls{/number}","milestones_url":"https://api.github.com/repos/DigitalNZ/contentful-redis/milestones{/number}","notifications_url":"https://api.github.com/repos/DigitalNZ/contentful-redis/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DigitalNZ/contentful-redis/labels{/name}","releases_url":"https://api.github.com/repos/DigitalNZ/contentful-redis/releases{/id}","deployments_url":"https://api.github.com/repos/DigitalNZ/contentful-redis/deployments","created_at":"2018-08-24T03:36:32Z","updated_at":"2018-09-07T02:51:42Z","pushed_at":"2018-09-21T00:20:36Z","git_url":"git://github.com/DigitalNZ/contentful-redis.git","ssh_url":"git@github.com:DigitalNZ/contentful-redis.git","clone_url":"https://github.com/DigitalNZ/contentful-redis.git","svn_url":"https://github.com/DigitalNZ/contentful-redis","homepage":null,"size":87,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":{"key":"gpl-3.0","name":"GNU General Public License v3.0","spdx_id":"GPL-3.0","url":"https://api.github.com/licenses/gpl-3.0","node_id":"MDc6TGljZW5zZTk="},"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"DigitalNZ:master","ref":"master","sha":"b87bef69e5e3f427df9fab3ebead2450f01307db","user":{"login":"DigitalNZ","id":93386,"node_id":"MDEyOk9yZ2FuaXphdGlvbjkzMzg2","avatar_url":"https://avatars2.githubusercontent.com/u/93386?v=4","gravatar_id":"","url":"https://api.github.com/users/DigitalNZ","html_url":"https://github.com/DigitalNZ","followers_url":"https://api.github.com/users/DigitalNZ/followers","following_url":"https://api.github.com/users/DigitalNZ/following{/other_user}","gists_url":"https://api.github.com/users/DigitalNZ/gists{/gist_id}","starred_url":"https://api.github.com/users/DigitalNZ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DigitalNZ/subscriptions","organizations_url":"https://api.github.com/users/DigitalNZ/orgs","repos_url":"https://api.github.com/users/DigitalNZ/repos","events_url":"https://api.github.com/users/DigitalNZ/events{/privacy}","received_events_url":"https://api.github.com/users/DigitalNZ/received_events","type":"Organization","site_admin":false},"repo":{"id":145938503,"node_id":"MDEwOlJlcG9zaXRvcnkxNDU5Mzg1MDM=","name":"contentful-redis","full_name":"DigitalNZ/contentful-redis","private":false,"owner":{"login":"DigitalNZ","id":93386,"node_id":"MDEyOk9yZ2FuaXphdGlvbjkzMzg2","avatar_url":"https://avatars2.githubusercontent.com/u/93386?v=4","gravatar_id":"","url":"https://api.github.com/users/DigitalNZ","html_url":"https://github.com/DigitalNZ","followers_url":"https://api.github.com/users/DigitalNZ/followers","following_url":"https://api.github.com/users/DigitalNZ/following{/other_user}","gists_url":"https://api.github.com/users/DigitalNZ/gists{/gist_id}","starred_url":"https://api.github.com/users/DigitalNZ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DigitalNZ/subscriptions","organizations_url":"https://api.github.com/users/DigitalNZ/orgs","repos_url":"https://api.github.com/users/DigitalNZ/repos","events_url":"https://api.github.com/users/DigitalNZ/events{/privacy}","received_events_url":"https://api.github.com/users/DigitalNZ/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/DigitalNZ/contentful-redis","description":"Contentful CMS API caching using Redis","fork":false,"url":"https://api.github.com/repos/DigitalNZ/contentful-redis","forks_url":"https://api.github.com/repos/DigitalNZ/contentful-redis/forks","keys_url":"https://api.github.com/repos/DigitalNZ/contentful-redis/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DigitalNZ/contentful-redis/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DigitalNZ/contentful-redis/teams","hooks_url":"https://api.github.com/repos/DigitalNZ/contentful-redis/hooks","issue_events_url":"https://api.github.com/repos/DigitalNZ/contentful-redis/issues/events{/number}","events_url":"https://api.github.com/repos/DigitalNZ/contentful-redis/events","assignees_url":"https://api.github.com/repos/DigitalNZ/contentful-redis/assignees{/user}","branches_url":"https://api.github.com/repos/DigitalNZ/contentful-redis/branches{/branch}","tags_url":"https://api.github.com/repos/DigitalNZ/contentful-redis/tags","blobs_url":"https://api.github.com/repos/DigitalNZ/contentful-redis/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DigitalNZ/contentful-redis/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DigitalNZ/contentful-redis/git/refs{/sha}","trees_url":"https://api.github.com/repos/DigitalNZ/contentful-redis/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DigitalNZ/contentful-redis/statuses/{sha}","languages_url":"https://api.github.com/repos/DigitalNZ/contentful-redis/languages","stargazers_url":"https://api.github.com/repos/DigitalNZ/contentful-redis/stargazers","contributors_url":"https://api.github.com/repos/DigitalNZ/contentful-redis/contributors","subscribers_url":"https://api.github.com/repos/DigitalNZ/contentful-redis/subscribers","subscription_url":"https://api.github.com/repos/DigitalNZ/contentful-redis/subscription","commits_url":"https://api.github.com/repos/DigitalNZ/contentful-redis/commits{/sha}","git_commits_url":"https://api.github.com/repos/DigitalNZ/contentful-redis/git/commits{/sha}","comments_url":"https://api.github.com/repos/DigitalNZ/contentful-redis/comments{/number}","issue_comment_url":"https://api.github.com/repos/DigitalNZ/contentful-redis/issues/comments{/number}","contents_url":"https://api.github.com/repos/DigitalNZ/contentful-redis/contents/{+path}","compare_url":"https://api.github.com/repos/DigitalNZ/contentful-redis/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DigitalNZ/contentful-redis/merges","archive_url":"https://api.github.com/repos/DigitalNZ/contentful-redis/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DigitalNZ/contentful-redis/downloads","issues_url":"https://api.github.com/repos/DigitalNZ/contentful-redis/issues{/number}","pulls_url":"https://api.github.com/repos/DigitalNZ/contentful-redis/pulls{/number}","milestones_url":"https://api.github.com/repos/DigitalNZ/contentful-redis/milestones{/number}","notifications_url":"https://api.github.com/repos/DigitalNZ/contentful-redis/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DigitalNZ/contentful-redis/labels{/name}","releases_url":"https://api.github.com/repos/DigitalNZ/contentful-redis/releases{/id}","deployments_url":"https://api.github.com/repos/DigitalNZ/contentful-redis/deployments","created_at":"2018-08-24T03:36:32Z","updated_at":"2018-09-07T02:51:42Z","pushed_at":"2018-09-21T00:20:36Z","git_url":"git://github.com/DigitalNZ/contentful-redis.git","ssh_url":"git@github.com:DigitalNZ/contentful-redis.git","clone_url":"https://github.com/DigitalNZ/contentful-redis.git","svn_url":"https://github.com/DigitalNZ/contentful-redis","homepage":null,"size":87,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":{"key":"gpl-3.0","name":"GNU General Public License v3.0","spdx_id":"GPL-3.0","url":"https://api.github.com/licenses/gpl-3.0","node_id":"MDc6TGljZW5zZTk="},"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/DigitalNZ/contentful-redis/pulls/1"},"html":{"href":"https://github.com/DigitalNZ/contentful-redis/pull/1"},"issue":{"href":"https://api.github.com/repos/DigitalNZ/contentful-redis/issues/1"},"comments":{"href":"https://api.github.com/repos/DigitalNZ/contentful-redis/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/DigitalNZ/contentful-redis/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/DigitalNZ/contentful-redis/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/DigitalNZ/contentful-redis/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/DigitalNZ/contentful-redis/statuses/a7856604d9abc6b70584931aeeed3cc1d302ca93"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"Reinkaos"}}