{"action":"created","comment":{"url":"https://api.github.com/repos/blueberryapps/translation-server/pulls/comments/46127403","id":46127403,"diff_hunk":"@@ -0,0 +1,19 @@\n+require 'digest'\n+class TranslationCache < ActiveRecord::Base\n+\n+  def self.cached?(kind:, etag:)\n+    where(kind: kind, etag: build_etag(etag)).first\n+  end\n+\n+  def self.cache(kind:, etag:, cache:)\n+    if cached = where(kind: kind).first","path":"app/models/translation_cache.rb","position":9,"original_position":9,"commit_id":"ca10ab166f99d94c748dd617b4342e22b2664cee","original_commit_id":"ca10ab166f99d94c748dd617b4342e22b2664cee","user":{"login":"mikekreeki","id":819445,"avatar_url":"https://avatars.githubusercontent.com/u/819445?v=3","gravatar_id":"","url":"https://api.github.com/users/mikekreeki","html_url":"https://github.com/mikekreeki","followers_url":"https://api.github.com/users/mikekreeki/followers","following_url":"https://api.github.com/users/mikekreeki/following{/other_user}","gists_url":"https://api.github.com/users/mikekreeki/gists{/gist_id}","starred_url":"https://api.github.com/users/mikekreeki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikekreeki/subscriptions","organizations_url":"https://api.github.com/users/mikekreeki/orgs","repos_url":"https://api.github.com/users/mikekreeki/repos","events_url":"https://api.github.com/users/mikekreeki/events{/privacy}","received_events_url":"https://api.github.com/users/mikekreeki/received_events","type":"User","site_admin":false},"body":"`find_by`","created_at":"2015-11-30T10:30:58Z","updated_at":"2015-11-30T10:30:58Z","html_url":"https://github.com/blueberryapps/translation-server/pull/42#discussion_r46127403","pull_request_url":"https://api.github.com/repos/blueberryapps/translation-server/pulls/42","_links":{"self":{"href":"https://api.github.com/repos/blueberryapps/translation-server/pulls/comments/46127403"},"html":{"href":"https://github.com/blueberryapps/translation-server/pull/42#discussion_r46127403"},"pull_request":{"href":"https://api.github.com/repos/blueberryapps/translation-server/pulls/42"}}},"pull_request":{"url":"https://api.github.com/repos/blueberryapps/translation-server/pulls/42","id":52105893,"html_url":"https://github.com/blueberryapps/translation-server/pull/42","diff_url":"https://github.com/blueberryapps/translation-server/pull/42.diff","patch_url":"https://github.com/blueberryapps/translation-server/pull/42.patch","issue_url":"https://api.github.com/repos/blueberryapps/translation-server/issues/42","number":42,"state":"open","locked":false,"title":"Add cache over translation api endpoint","user":{"login":"ondrejbartas","id":45809,"avatar_url":"https://avatars.githubusercontent.com/u/45809?v=3","gravatar_id":"","url":"https://api.github.com/users/ondrejbartas","html_url":"https://github.com/ondrejbartas","followers_url":"https://api.github.com/users/ondrejbartas/followers","following_url":"https://api.github.com/users/ondrejbartas/following{/other_user}","gists_url":"https://api.github.com/users/ondrejbartas/gists{/gist_id}","starred_url":"https://api.github.com/users/ondrejbartas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ondrejbartas/subscriptions","organizations_url":"https://api.github.com/users/ondrejbartas/orgs","repos_url":"https://api.github.com/users/ondrejbartas/repos","events_url":"https://api.github.com/users/ondrejbartas/events{/privacy}","received_events_url":"https://api.github.com/users/ondrejbartas/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-11-30T10:20:54Z","updated_at":"2015-11-30T10:30:58Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7938089fb09582d1a180b422b4a225b6a8835248","assignee":{"login":"mikekreeki","id":819445,"avatar_url":"https://avatars.githubusercontent.com/u/819445?v=3","gravatar_id":"","url":"https://api.github.com/users/mikekreeki","html_url":"https://github.com/mikekreeki","followers_url":"https://api.github.com/users/mikekreeki/followers","following_url":"https://api.github.com/users/mikekreeki/following{/other_user}","gists_url":"https://api.github.com/users/mikekreeki/gists{/gist_id}","starred_url":"https://api.github.com/users/mikekreeki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikekreeki/subscriptions","organizations_url":"https://api.github.com/users/mikekreeki/orgs","repos_url":"https://api.github.com/users/mikekreeki/repos","events_url":"https://api.github.com/users/mikekreeki/events{/privacy}","received_events_url":"https://api.github.com/users/mikekreeki/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/blueberryapps/translation-server/pulls/42/commits","review_comments_url":"https://api.github.com/repos/blueberryapps/translation-server/pulls/42/comments","review_comment_url":"https://api.github.com/repos/blueberryapps/translation-server/pulls/comments{/number}","comments_url":"https://api.github.com/repos/blueberryapps/translation-server/issues/42/comments","statuses_url":"https://api.github.com/repos/blueberryapps/translation-server/statuses/ca10ab166f99d94c748dd617b4342e22b2664cee","head":{"label":"blueberryapps:ctt1185-cache","ref":"ctt1185-cache","sha":"ca10ab166f99d94c748dd617b4342e22b2664cee","user":{"login":"blueberryapps","id":63473,"avatar_url":"https://avatars.githubusercontent.com/u/63473?v=3","gravatar_id":"","url":"https://api.github.com/users/blueberryapps","html_url":"https://github.com/blueberryapps","followers_url":"https://api.github.com/users/blueberryapps/followers","following_url":"https://api.github.com/users/blueberryapps/following{/other_user}","gists_url":"https://api.github.com/users/blueberryapps/gists{/gist_id}","starred_url":"https://api.github.com/users/blueberryapps/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/blueberryapps/subscriptions","organizations_url":"https://api.github.com/users/blueberryapps/orgs","repos_url":"https://api.github.com/users/blueberryapps/repos","events_url":"https://api.github.com/users/blueberryapps/events{/privacy}","received_events_url":"https://api.github.com/users/blueberryapps/received_events","type":"Organization","site_admin":false},"repo":{"id":31547435,"name":"translation-server","full_name":"blueberryapps/translation-server","owner":{"login":"blueberryapps","id":63473,"avatar_url":"https://avatars.githubusercontent.com/u/63473?v=3","gravatar_id":"","url":"https://api.github.com/users/blueberryapps","html_url":"https://github.com/blueberryapps","followers_url":"https://api.github.com/users/blueberryapps/followers","following_url":"https://api.github.com/users/blueberryapps/following{/other_user}","gists_url":"https://api.github.com/users/blueberryapps/gists{/gist_id}","starred_url":"https://api.github.com/users/blueberryapps/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/blueberryapps/subscriptions","organizations_url":"https://api.github.com/users/blueberryapps/orgs","repos_url":"https://api.github.com/users/blueberryapps/repos","events_url":"https://api.github.com/users/blueberryapps/events{/privacy}","received_events_url":"https://api.github.com/users/blueberryapps/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/blueberryapps/translation-server","description":"Stores translations with location and screenshot. Enable users to easily edit translations and then any rails application can use them.","fork":false,"url":"https://api.github.com/repos/blueberryapps/translation-server","forks_url":"https://api.github.com/repos/blueberryapps/translation-server/forks","keys_url":"https://api.github.com/repos/blueberryapps/translation-server/keys{/key_id}","collaborators_url":"https://api.github.com/repos/blueberryapps/translation-server/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/blueberryapps/translation-server/teams","hooks_url":"https://api.github.com/repos/blueberryapps/translation-server/hooks","issue_events_url":"https://api.github.com/repos/blueberryapps/translation-server/issues/events{/number}","events_url":"https://api.github.com/repos/blueberryapps/translation-server/events","assignees_url":"https://api.github.com/repos/blueberryapps/translation-server/assignees{/user}","branches_url":"https://api.github.com/repos/blueberryapps/translation-server/branches{/branch}","tags_url":"https://api.github.com/repos/blueberryapps/translation-server/tags","blobs_url":"https://api.github.com/repos/blueberryapps/translation-server/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/blueberryapps/translation-server/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/blueberryapps/translation-server/git/refs{/sha}","trees_url":"https://api.github.com/repos/blueberryapps/translation-server/git/trees{/sha}","statuses_url":"https://api.github.com/repos/blueberryapps/translation-server/statuses/{sha}","languages_url":"https://api.github.com/repos/blueberryapps/translation-server/languages","stargazers_url":"https://api.github.com/repos/blueberryapps/translation-server/stargazers","contributors_url":"https://api.github.com/repos/blueberryapps/translation-server/contributors","subscribers_url":"https://api.github.com/repos/blueberryapps/translation-server/subscribers","subscription_url":"https://api.github.com/repos/blueberryapps/translation-server/subscription","commits_url":"https://api.github.com/repos/blueberryapps/translation-server/commits{/sha}","git_commits_url":"https://api.github.com/repos/blueberryapps/translation-server/git/commits{/sha}","comments_url":"https://api.github.com/repos/blueberryapps/translation-server/comments{/number}","issue_comment_url":"https://api.github.com/repos/blueberryapps/translation-server/issues/comments{/number}","contents_url":"https://api.github.com/repos/blueberryapps/translation-server/contents/{+path}","compare_url":"https://api.github.com/repos/blueberryapps/translation-server/compare/{base}...{head}","merges_url":"https://api.github.com/repos/blueberryapps/translation-server/merges","archive_url":"https://api.github.com/repos/blueberryapps/translation-server/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/blueberryapps/translation-server/downloads","issues_url":"https://api.github.com/repos/blueberryapps/translation-server/issues{/number}","pulls_url":"https://api.github.com/repos/blueberryapps/translation-server/pulls{/number}","milestones_url":"https://api.github.com/repos/blueberryapps/translation-server/milestones{/number}","notifications_url":"https://api.github.com/repos/blueberryapps/translation-server/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/blueberryapps/translation-server/labels{/name}","releases_url":"https://api.github.com/repos/blueberryapps/translation-server/releases{/id}","created_at":"2015-03-02T15:38:20Z","updated_at":"2015-10-23T12:41:26Z","pushed_at":"2015-11-30T10:20:54Z","git_url":"git://github.com/blueberryapps/translation-server.git","ssh_url":"git@github.com:blueberryapps/translation-server.git","clone_url":"https://github.com/blueberryapps/translation-server.git","svn_url":"https://github.com/blueberryapps/translation-server","homepage":"","size":403,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":5,"forks":0,"open_issues":5,"watchers":0,"default_branch":"master"}},"base":{"label":"blueberryapps:master","ref":"master","sha":"52eb641aa5ab4942d5b6e398b067431223abfcc2","user":{"login":"blueberryapps","id":63473,"avatar_url":"https://avatars.githubusercontent.com/u/63473?v=3","gravatar_id":"","url":"https://api.github.com/users/blueberryapps","html_url":"https://github.com/blueberryapps","followers_url":"https://api.github.com/users/blueberryapps/followers","following_url":"https://api.github.com/users/blueberryapps/following{/other_user}","gists_url":"https://api.github.com/users/blueberryapps/gists{/gist_id}","starred_url":"https://api.github.com/users/blueberryapps/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/blueberryapps/subscriptions","organizations_url":"https://api.github.com/users/blueberryapps/orgs","repos_url":"https://api.github.com/users/blueberryapps/repos","events_url":"https://api.github.com/users/blueberryapps/events{/privacy}","received_events_url":"https://api.github.com/users/blueberryapps/received_events","type":"Organization","site_admin":false},"repo":{"id":31547435,"name":"translation-server","full_name":"blueberryapps/translation-server","owner":{"login":"blueberryapps","id":63473,"avatar_url":"https://avatars.githubusercontent.com/u/63473?v=3","gravatar_id":"","url":"https://api.github.com/users/blueberryapps","html_url":"https://github.com/blueberryapps","followers_url":"https://api.github.com/users/blueberryapps/followers","following_url":"https://api.github.com/users/blueberryapps/following{/other_user}","gists_url":"https://api.github.com/users/blueberryapps/gists{/gist_id}","starred_url":"https://api.github.com/users/blueberryapps/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/blueberryapps/subscriptions","organizations_url":"https://api.github.com/users/blueberryapps/orgs","repos_url":"https://api.github.com/users/blueberryapps/repos","events_url":"https://api.github.com/users/blueberryapps/events{/privacy}","received_events_url":"https://api.github.com/users/blueberryapps/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/blueberryapps/translation-server","description":"Stores translations with location and screenshot. Enable users to easily edit translations and then any rails application can use them.","fork":false,"url":"https://api.github.com/repos/blueberryapps/translation-server","forks_url":"https://api.github.com/repos/blueberryapps/translation-server/forks","keys_url":"https://api.github.com/repos/blueberryapps/translation-server/keys{/key_id}","collaborators_url":"https://api.github.com/repos/blueberryapps/translation-server/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/blueberryapps/translation-server/teams","hooks_url":"https://api.github.com/repos/blueberryapps/translation-server/hooks","issue_events_url":"https://api.github.com/repos/blueberryapps/translation-server/issues/events{/number}","events_url":"https://api.github.com/repos/blueberryapps/translation-server/events","assignees_url":"https://api.github.com/repos/blueberryapps/translation-server/assignees{/user}","branches_url":"https://api.github.com/repos/blueberryapps/translation-server/branches{/branch}","tags_url":"https://api.github.com/repos/blueberryapps/translation-server/tags","blobs_url":"https://api.github.com/repos/blueberryapps/translation-server/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/blueberryapps/translation-server/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/blueberryapps/translation-server/git/refs{/sha}","trees_url":"https://api.github.com/repos/blueberryapps/translation-server/git/trees{/sha}","statuses_url":"https://api.github.com/repos/blueberryapps/translation-server/statuses/{sha}","languages_url":"https://api.github.com/repos/blueberryapps/translation-server/languages","stargazers_url":"https://api.github.com/repos/blueberryapps/translation-server/stargazers","contributors_url":"https://api.github.com/repos/blueberryapps/translation-server/contributors","subscribers_url":"https://api.github.com/repos/blueberryapps/translation-server/subscribers","subscription_url":"https://api.github.com/repos/blueberryapps/translation-server/subscription","commits_url":"https://api.github.com/repos/blueberryapps/translation-server/commits{/sha}","git_commits_url":"https://api.github.com/repos/blueberryapps/translation-server/git/commits{/sha}","comments_url":"https://api.github.com/repos/blueberryapps/translation-server/comments{/number}","issue_comment_url":"https://api.github.com/repos/blueberryapps/translation-server/issues/comments{/number}","contents_url":"https://api.github.com/repos/blueberryapps/translation-server/contents/{+path}","compare_url":"https://api.github.com/repos/blueberryapps/translation-server/compare/{base}...{head}","merges_url":"https://api.github.com/repos/blueberryapps/translation-server/merges","archive_url":"https://api.github.com/repos/blueberryapps/translation-server/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/blueberryapps/translation-server/downloads","issues_url":"https://api.github.com/repos/blueberryapps/translation-server/issues{/number}","pulls_url":"https://api.github.com/repos/blueberryapps/translation-server/pulls{/number}","milestones_url":"https://api.github.com/repos/blueberryapps/translation-server/milestones{/number}","notifications_url":"https://api.github.com/repos/blueberryapps/translation-server/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/blueberryapps/translation-server/labels{/name}","releases_url":"https://api.github.com/repos/blueberryapps/translation-server/releases{/id}","created_at":"2015-03-02T15:38:20Z","updated_at":"2015-10-23T12:41:26Z","pushed_at":"2015-11-30T10:20:54Z","git_url":"git://github.com/blueberryapps/translation-server.git","ssh_url":"git@github.com:blueberryapps/translation-server.git","clone_url":"https://github.com/blueberryapps/translation-server.git","svn_url":"https://github.com/blueberryapps/translation-server","homepage":"","size":403,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":5,"forks":0,"open_issues":5,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/blueberryapps/translation-server/pulls/42"},"html":{"href":"https://github.com/blueberryapps/translation-server/pull/42"},"issue":{"href":"https://api.github.com/repos/blueberryapps/translation-server/issues/42"},"comments":{"href":"https://api.github.com/repos/blueberryapps/translation-server/issues/42/comments"},"review_comments":{"href":"https://api.github.com/repos/blueberryapps/translation-server/pulls/42/comments"},"review_comment":{"href":"https://api.github.com/repos/blueberryapps/translation-server/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/blueberryapps/translation-server/pulls/42/commits"},"statuses":{"href":"https://api.github.com/repos/blueberryapps/translation-server/statuses/ca10ab166f99d94c748dd617b4342e22b2664cee"}}}}