{"action":"closed","number":5,"pull_request":{"url":"https://api.github.com/repos/experteer/cached_enumeration/pulls/5","id":45899686,"html_url":"https://github.com/experteer/cached_enumeration/pull/5","diff_url":"https://github.com/experteer/cached_enumeration/pull/5.diff","patch_url":"https://github.com/experteer/cached_enumeration/pull/5.patch","issue_url":"https://api.github.com/repos/experteer/cached_enumeration/issues/5","number":5,"state":"closed","locked":false,"title":"Refactor caching","user":{"login":"michaelsauter","id":215455,"avatar_url":"https://avatars.githubusercontent.com/u/215455?v=3","gravatar_id":"","url":"https://api.github.com/users/michaelsauter","html_url":"https://github.com/michaelsauter","followers_url":"https://api.github.com/users/michaelsauter/followers","following_url":"https://api.github.com/users/michaelsauter/following{/other_user}","gists_url":"https://api.github.com/users/michaelsauter/gists{/gist_id}","starred_url":"https://api.github.com/users/michaelsauter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michaelsauter/subscriptions","organizations_url":"https://api.github.com/users/michaelsauter/orgs","repos_url":"https://api.github.com/users/michaelsauter/repos","events_url":"https://api.github.com/users/michaelsauter/events{/privacy}","received_events_url":"https://api.github.com/users/michaelsauter/received_events","type":"User","site_admin":false},"body":"Rails 4.2 will have \"AdequateRecord\", which prevents us from\r\ncaching the way we do it currently.\r\n\r\nBefore this change, we have the following scenario:\r\n\r\n* +all+ is cached (with the alias +cached_all+)\r\n* +where+ is not cached\r\n* +by_xyz+ is cached (depending on all_with_....)\r\n* +find_by_xyz+ is cached (depending on all_with_...)\r\n* +find+ is cached (depending on find_one_with_.../find_some_with...)\r\n* +first+ is cached (depending on find_first_with_....)\r\n* Constants are cached (depending on all_with_...)\r\n\r\nAfter this change, we still cache the same, but the implementation is\r\nquite different. Mainly:\r\n\r\n* +find_by_xyz+ is implemented via +by_xyz+\r\n* +find+ is implemented via +by_id+\r\n* +first+ is implemented via +all.first+\r\n\r\nAll usage of arguments for +all+, +find+, +first+ etc. results in\r\nthe cache not being used.\r\n\r\nAdditionally, due to the implementation change, relations were cached\r\npreviously, now they are not anymore.","created_at":"2015-09-24T13:55:30Z","updated_at":"2015-09-24T15:51:27Z","closed_at":"2015-09-24T15:51:27Z","merged_at":"2015-09-24T15:51:27Z","merge_commit_sha":"0d862bee875f40f1b6ec5bb3f48aa38287fe8a22","assignee":{"login":"tsrivishnu","id":2265280,"avatar_url":"https://avatars.githubusercontent.com/u/2265280?v=3","gravatar_id":"","url":"https://api.github.com/users/tsrivishnu","html_url":"https://github.com/tsrivishnu","followers_url":"https://api.github.com/users/tsrivishnu/followers","following_url":"https://api.github.com/users/tsrivishnu/following{/other_user}","gists_url":"https://api.github.com/users/tsrivishnu/gists{/gist_id}","starred_url":"https://api.github.com/users/tsrivishnu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tsrivishnu/subscriptions","organizations_url":"https://api.github.com/users/tsrivishnu/orgs","repos_url":"https://api.github.com/users/tsrivishnu/repos","events_url":"https://api.github.com/users/tsrivishnu/events{/privacy}","received_events_url":"https://api.github.com/users/tsrivishnu/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/experteer/cached_enumeration/pulls/5/commits","review_comments_url":"https://api.github.com/repos/experteer/cached_enumeration/pulls/5/comments","review_comment_url":"https://api.github.com/repos/experteer/cached_enumeration/pulls/comments{/number}","comments_url":"https://api.github.com/repos/experteer/cached_enumeration/issues/5/comments","statuses_url":"https://api.github.com/repos/experteer/cached_enumeration/statuses/2ec81b7bce8c54935c5d475576d481d6c4dcb26a","head":{"label":"experteer:task/refactor-caching","ref":"task/refactor-caching","sha":"2ec81b7bce8c54935c5d475576d481d6c4dcb26a","user":{"login":"experteer","id":124137,"avatar_url":"https://avatars.githubusercontent.com/u/124137?v=3","gravatar_id":"","url":"https://api.github.com/users/experteer","html_url":"https://github.com/experteer","followers_url":"https://api.github.com/users/experteer/followers","following_url":"https://api.github.com/users/experteer/following{/other_user}","gists_url":"https://api.github.com/users/experteer/gists{/gist_id}","starred_url":"https://api.github.com/users/experteer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/experteer/subscriptions","organizations_url":"https://api.github.com/users/experteer/orgs","repos_url":"https://api.github.com/users/experteer/repos","events_url":"https://api.github.com/users/experteer/events{/privacy}","received_events_url":"https://api.github.com/users/experteer/received_events","type":"Organization","site_admin":false},"repo":{"id":10837823,"name":"cached_enumeration","full_name":"experteer/cached_enumeration","owner":{"login":"experteer","id":124137,"avatar_url":"https://avatars.githubusercontent.com/u/124137?v=3","gravatar_id":"","url":"https://api.github.com/users/experteer","html_url":"https://github.com/experteer","followers_url":"https://api.github.com/users/experteer/followers","following_url":"https://api.github.com/users/experteer/following{/other_user}","gists_url":"https://api.github.com/users/experteer/gists{/gist_id}","starred_url":"https://api.github.com/users/experteer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/experteer/subscriptions","organizations_url":"https://api.github.com/users/experteer/orgs","repos_url":"https://api.github.com/users/experteer/repos","events_url":"https://api.github.com/users/experteer/events{/privacy}","received_events_url":"https://api.github.com/users/experteer/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/experteer/cached_enumeration","description":"","fork":false,"url":"https://api.github.com/repos/experteer/cached_enumeration","forks_url":"https://api.github.com/repos/experteer/cached_enumeration/forks","keys_url":"https://api.github.com/repos/experteer/cached_enumeration/keys{/key_id}","collaborators_url":"https://api.github.com/repos/experteer/cached_enumeration/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/experteer/cached_enumeration/teams","hooks_url":"https://api.github.com/repos/experteer/cached_enumeration/hooks","issue_events_url":"https://api.github.com/repos/experteer/cached_enumeration/issues/events{/number}","events_url":"https://api.github.com/repos/experteer/cached_enumeration/events","assignees_url":"https://api.github.com/repos/experteer/cached_enumeration/assignees{/user}","branches_url":"https://api.github.com/repos/experteer/cached_enumeration/branches{/branch}","tags_url":"https://api.github.com/repos/experteer/cached_enumeration/tags","blobs_url":"https://api.github.com/repos/experteer/cached_enumeration/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/experteer/cached_enumeration/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/experteer/cached_enumeration/git/refs{/sha}","trees_url":"https://api.github.com/repos/experteer/cached_enumeration/git/trees{/sha}","statuses_url":"https://api.github.com/repos/experteer/cached_enumeration/statuses/{sha}","languages_url":"https://api.github.com/repos/experteer/cached_enumeration/languages","stargazers_url":"https://api.github.com/repos/experteer/cached_enumeration/stargazers","contributors_url":"https://api.github.com/repos/experteer/cached_enumeration/contributors","subscribers_url":"https://api.github.com/repos/experteer/cached_enumeration/subscribers","subscription_url":"https://api.github.com/repos/experteer/cached_enumeration/subscription","commits_url":"https://api.github.com/repos/experteer/cached_enumeration/commits{/sha}","git_commits_url":"https://api.github.com/repos/experteer/cached_enumeration/git/commits{/sha}","comments_url":"https://api.github.com/repos/experteer/cached_enumeration/comments{/number}","issue_comment_url":"https://api.github.com/repos/experteer/cached_enumeration/issues/comments{/number}","contents_url":"https://api.github.com/repos/experteer/cached_enumeration/contents/{+path}","compare_url":"https://api.github.com/repos/experteer/cached_enumeration/compare/{base}...{head}","merges_url":"https://api.github.com/repos/experteer/cached_enumeration/merges","archive_url":"https://api.github.com/repos/experteer/cached_enumeration/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/experteer/cached_enumeration/downloads","issues_url":"https://api.github.com/repos/experteer/cached_enumeration/issues{/number}","pulls_url":"https://api.github.com/repos/experteer/cached_enumeration/pulls{/number}","milestones_url":"https://api.github.com/repos/experteer/cached_enumeration/milestones{/number}","notifications_url":"https://api.github.com/repos/experteer/cached_enumeration/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/experteer/cached_enumeration/labels{/name}","releases_url":"https://api.github.com/repos/experteer/cached_enumeration/releases{/id}","created_at":"2013-06-21T07:41:54Z","updated_at":"2014-10-20T11:39:42Z","pushed_at":"2015-09-24T15:51:28Z","git_url":"git://github.com/experteer/cached_enumeration.git","ssh_url":"git@github.com:experteer/cached_enumeration.git","clone_url":"https://github.com/experteer/cached_enumeration.git","svn_url":"https://github.com/experteer/cached_enumeration","homepage":null,"size":328,"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":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"experteer:rails32","ref":"rails32","sha":"fd0e36e3e1a21be6b786b02e26830dffbdb8be10","user":{"login":"experteer","id":124137,"avatar_url":"https://avatars.githubusercontent.com/u/124137?v=3","gravatar_id":"","url":"https://api.github.com/users/experteer","html_url":"https://github.com/experteer","followers_url":"https://api.github.com/users/experteer/followers","following_url":"https://api.github.com/users/experteer/following{/other_user}","gists_url":"https://api.github.com/users/experteer/gists{/gist_id}","starred_url":"https://api.github.com/users/experteer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/experteer/subscriptions","organizations_url":"https://api.github.com/users/experteer/orgs","repos_url":"https://api.github.com/users/experteer/repos","events_url":"https://api.github.com/users/experteer/events{/privacy}","received_events_url":"https://api.github.com/users/experteer/received_events","type":"Organization","site_admin":false},"repo":{"id":10837823,"name":"cached_enumeration","full_name":"experteer/cached_enumeration","owner":{"login":"experteer","id":124137,"avatar_url":"https://avatars.githubusercontent.com/u/124137?v=3","gravatar_id":"","url":"https://api.github.com/users/experteer","html_url":"https://github.com/experteer","followers_url":"https://api.github.com/users/experteer/followers","following_url":"https://api.github.com/users/experteer/following{/other_user}","gists_url":"https://api.github.com/users/experteer/gists{/gist_id}","starred_url":"https://api.github.com/users/experteer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/experteer/subscriptions","organizations_url":"https://api.github.com/users/experteer/orgs","repos_url":"https://api.github.com/users/experteer/repos","events_url":"https://api.github.com/users/experteer/events{/privacy}","received_events_url":"https://api.github.com/users/experteer/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/experteer/cached_enumeration","description":"","fork":false,"url":"https://api.github.com/repos/experteer/cached_enumeration","forks_url":"https://api.github.com/repos/experteer/cached_enumeration/forks","keys_url":"https://api.github.com/repos/experteer/cached_enumeration/keys{/key_id}","collaborators_url":"https://api.github.com/repos/experteer/cached_enumeration/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/experteer/cached_enumeration/teams","hooks_url":"https://api.github.com/repos/experteer/cached_enumeration/hooks","issue_events_url":"https://api.github.com/repos/experteer/cached_enumeration/issues/events{/number}","events_url":"https://api.github.com/repos/experteer/cached_enumeration/events","assignees_url":"https://api.github.com/repos/experteer/cached_enumeration/assignees{/user}","branches_url":"https://api.github.com/repos/experteer/cached_enumeration/branches{/branch}","tags_url":"https://api.github.com/repos/experteer/cached_enumeration/tags","blobs_url":"https://api.github.com/repos/experteer/cached_enumeration/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/experteer/cached_enumeration/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/experteer/cached_enumeration/git/refs{/sha}","trees_url":"https://api.github.com/repos/experteer/cached_enumeration/git/trees{/sha}","statuses_url":"https://api.github.com/repos/experteer/cached_enumeration/statuses/{sha}","languages_url":"https://api.github.com/repos/experteer/cached_enumeration/languages","stargazers_url":"https://api.github.com/repos/experteer/cached_enumeration/stargazers","contributors_url":"https://api.github.com/repos/experteer/cached_enumeration/contributors","subscribers_url":"https://api.github.com/repos/experteer/cached_enumeration/subscribers","subscription_url":"https://api.github.com/repos/experteer/cached_enumeration/subscription","commits_url":"https://api.github.com/repos/experteer/cached_enumeration/commits{/sha}","git_commits_url":"https://api.github.com/repos/experteer/cached_enumeration/git/commits{/sha}","comments_url":"https://api.github.com/repos/experteer/cached_enumeration/comments{/number}","issue_comment_url":"https://api.github.com/repos/experteer/cached_enumeration/issues/comments{/number}","contents_url":"https://api.github.com/repos/experteer/cached_enumeration/contents/{+path}","compare_url":"https://api.github.com/repos/experteer/cached_enumeration/compare/{base}...{head}","merges_url":"https://api.github.com/repos/experteer/cached_enumeration/merges","archive_url":"https://api.github.com/repos/experteer/cached_enumeration/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/experteer/cached_enumeration/downloads","issues_url":"https://api.github.com/repos/experteer/cached_enumeration/issues{/number}","pulls_url":"https://api.github.com/repos/experteer/cached_enumeration/pulls{/number}","milestones_url":"https://api.github.com/repos/experteer/cached_enumeration/milestones{/number}","notifications_url":"https://api.github.com/repos/experteer/cached_enumeration/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/experteer/cached_enumeration/labels{/name}","releases_url":"https://api.github.com/repos/experteer/cached_enumeration/releases{/id}","created_at":"2013-06-21T07:41:54Z","updated_at":"2014-10-20T11:39:42Z","pushed_at":"2015-09-24T15:51:28Z","git_url":"git://github.com/experteer/cached_enumeration.git","ssh_url":"git@github.com:experteer/cached_enumeration.git","clone_url":"https://github.com/experteer/cached_enumeration.git","svn_url":"https://github.com/experteer/cached_enumeration","homepage":null,"size":328,"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":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/experteer/cached_enumeration/pulls/5"},"html":{"href":"https://github.com/experteer/cached_enumeration/pull/5"},"issue":{"href":"https://api.github.com/repos/experteer/cached_enumeration/issues/5"},"comments":{"href":"https://api.github.com/repos/experteer/cached_enumeration/issues/5/comments"},"review_comments":{"href":"https://api.github.com/repos/experteer/cached_enumeration/pulls/5/comments"},"review_comment":{"href":"https://api.github.com/repos/experteer/cached_enumeration/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/experteer/cached_enumeration/pulls/5/commits"},"statuses":{"href":"https://api.github.com/repos/experteer/cached_enumeration/statuses/2ec81b7bce8c54935c5d475576d481d6c4dcb26a"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"michaelsauter","id":215455,"avatar_url":"https://avatars.githubusercontent.com/u/215455?v=3","gravatar_id":"","url":"https://api.github.com/users/michaelsauter","html_url":"https://github.com/michaelsauter","followers_url":"https://api.github.com/users/michaelsauter/followers","following_url":"https://api.github.com/users/michaelsauter/following{/other_user}","gists_url":"https://api.github.com/users/michaelsauter/gists{/gist_id}","starred_url":"https://api.github.com/users/michaelsauter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michaelsauter/subscriptions","organizations_url":"https://api.github.com/users/michaelsauter/orgs","repos_url":"https://api.github.com/users/michaelsauter/repos","events_url":"https://api.github.com/users/michaelsauter/events{/privacy}","received_events_url":"https://api.github.com/users/michaelsauter/received_events","type":"User","site_admin":false},"comments":2,"review_comments":0,"commits":2,"additions":104,"deletions":266,"changed_files":7}}