{"action":"created","comment":{"url":"https://api.github.com/repos/rails/rails/pulls/comments/45249431","id":45249431,"diff_hunk":"@@ -529,16 +529,17 @@ def expanded_key(key) # :nodoc:\n \n         # Prefix a key with the namespace. Namespace and key will be delimited\n         # with a colon.\n-        def namespaced_key(key, options)\n+        def normalize_key(key, options)\n           key = expanded_key(key)\n           namespace = options[:namespace] if options\n           prefix = namespace.is_a?(Proc) ? namespace.call : namespace\n           key = \"#{prefix}:#{key}\" if prefix\n           key\n         end\n+        alias namespaced_key normalize_key","path":"activesupport/lib/active_support/cache.rb","position":66,"original_position":66,"commit_id":"f6bc5acf1006ef4c6cac03aee4b76d62e54465d4","original_commit_id":"f6bc5acf1006ef4c6cac03aee4b76d62e54465d4","user":{"login":"kaspth","id":350807,"avatar_url":"https://avatars.githubusercontent.com/u/350807?v=3","gravatar_id":"","url":"https://api.github.com/users/kaspth","html_url":"https://github.com/kaspth","followers_url":"https://api.github.com/users/kaspth/followers","following_url":"https://api.github.com/users/kaspth/following{/other_user}","gists_url":"https://api.github.com/users/kaspth/gists{/gist_id}","starred_url":"https://api.github.com/users/kaspth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kaspth/subscriptions","organizations_url":"https://api.github.com/users/kaspth/orgs","repos_url":"https://api.github.com/users/kaspth/repos","events_url":"https://api.github.com/users/kaspth/events{/privacy}","received_events_url":"https://api.github.com/users/kaspth/received_events","type":"User","site_admin":false},"body":"This doesn't cover backwards compatibility. The file and mem cache stores changes break user written subclasses.","created_at":"2015-11-18T19:42:52Z","updated_at":"2015-11-18T19:42:52Z","html_url":"https://github.com/rails/rails/pull/22215#discussion_r45249431","pull_request_url":"https://api.github.com/repos/rails/rails/pulls/22215","_links":{"self":{"href":"https://api.github.com/repos/rails/rails/pulls/comments/45249431"},"html":{"href":"https://github.com/rails/rails/pull/22215#discussion_r45249431"},"pull_request":{"href":"https://api.github.com/repos/rails/rails/pulls/22215"}}},"pull_request":{"url":"https://api.github.com/repos/rails/rails/pulls/22215","id":50044347,"html_url":"https://github.com/rails/rails/pull/22215","diff_url":"https://github.com/rails/rails/pull/22215.diff","patch_url":"https://github.com/rails/rails/pull/22215.patch","issue_url":"https://api.github.com/repos/rails/rails/issues/22215","number":22215,"state":"closed","locked":false,"title":"send normalized keys to the cache backends so they do not need to man…","user":{"login":"grosser","id":11367,"avatar_url":"https://avatars.githubusercontent.com/u/11367?v=3","gravatar_id":"","url":"https://api.github.com/users/grosser","html_url":"https://github.com/grosser","followers_url":"https://api.github.com/users/grosser/followers","following_url":"https://api.github.com/users/grosser/following{/other_user}","gists_url":"https://api.github.com/users/grosser/gists{/gist_id}","starred_url":"https://api.github.com/users/grosser/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/grosser/subscriptions","organizations_url":"https://api.github.com/users/grosser/orgs","repos_url":"https://api.github.com/users/grosser/repos","events_url":"https://api.github.com/users/grosser/events{/privacy}","received_events_url":"https://api.github.com/users/grosser/received_events","type":"User","site_admin":false},"body":"…age this themselves\r\n\r\nkey manipulation is a recurring pattern in the cache stores (base + file + mem_cached) which makes the code less readable and mixes concerns\r\n\r\nthis moves all the key manipulation into a single method normalize_key and reuses that, which will also enable users to inherit or share logic better via modules since they no longer have to modify the key (escape_key or key_file_path or namespaced_key)","created_at":"2015-11-07T20:17:51Z","updated_at":"2015-11-18T19:42:52Z","closed_at":"2015-11-16T20:12:19Z","merged_at":"2015-11-16T20:12:19Z","merge_commit_sha":"89923aaa2b7168ca235dcb533d0a2b100ad94dad","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/rails/rails/pulls/22215/commits","review_comments_url":"https://api.github.com/repos/rails/rails/pulls/22215/comments","review_comment_url":"https://api.github.com/repos/rails/rails/pulls/comments{/number}","comments_url":"https://api.github.com/repos/rails/rails/issues/22215/comments","statuses_url":"https://api.github.com/repos/rails/rails/statuses/f6bc5acf1006ef4c6cac03aee4b76d62e54465d4","head":{"label":"grosser:grosser/normalize_key","ref":"grosser/normalize_key","sha":"f6bc5acf1006ef4c6cac03aee4b76d62e54465d4","user":{"login":"grosser","id":11367,"avatar_url":"https://avatars.githubusercontent.com/u/11367?v=3","gravatar_id":"","url":"https://api.github.com/users/grosser","html_url":"https://github.com/grosser","followers_url":"https://api.github.com/users/grosser/followers","following_url":"https://api.github.com/users/grosser/following{/other_user}","gists_url":"https://api.github.com/users/grosser/gists{/gist_id}","starred_url":"https://api.github.com/users/grosser/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/grosser/subscriptions","organizations_url":"https://api.github.com/users/grosser/orgs","repos_url":"https://api.github.com/users/grosser/repos","events_url":"https://api.github.com/users/grosser/events{/privacy}","received_events_url":"https://api.github.com/users/grosser/received_events","type":"User","site_admin":false},"repo":{"id":4285712,"name":"rails","full_name":"grosser/rails","owner":{"login":"grosser","id":11367,"avatar_url":"https://avatars.githubusercontent.com/u/11367?v=3","gravatar_id":"","url":"https://api.github.com/users/grosser","html_url":"https://github.com/grosser","followers_url":"https://api.github.com/users/grosser/followers","following_url":"https://api.github.com/users/grosser/following{/other_user}","gists_url":"https://api.github.com/users/grosser/gists{/gist_id}","starred_url":"https://api.github.com/users/grosser/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/grosser/subscriptions","organizations_url":"https://api.github.com/users/grosser/orgs","repos_url":"https://api.github.com/users/grosser/repos","events_url":"https://api.github.com/users/grosser/events{/privacy}","received_events_url":"https://api.github.com/users/grosser/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/grosser/rails","description":"Ruby on Rails","fork":true,"url":"https://api.github.com/repos/grosser/rails","forks_url":"https://api.github.com/repos/grosser/rails/forks","keys_url":"https://api.github.com/repos/grosser/rails/keys{/key_id}","collaborators_url":"https://api.github.com/repos/grosser/rails/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/grosser/rails/teams","hooks_url":"https://api.github.com/repos/grosser/rails/hooks","issue_events_url":"https://api.github.com/repos/grosser/rails/issues/events{/number}","events_url":"https://api.github.com/repos/grosser/rails/events","assignees_url":"https://api.github.com/repos/grosser/rails/assignees{/user}","branches_url":"https://api.github.com/repos/grosser/rails/branches{/branch}","tags_url":"https://api.github.com/repos/grosser/rails/tags","blobs_url":"https://api.github.com/repos/grosser/rails/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/grosser/rails/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/grosser/rails/git/refs{/sha}","trees_url":"https://api.github.com/repos/grosser/rails/git/trees{/sha}","statuses_url":"https://api.github.com/repos/grosser/rails/statuses/{sha}","languages_url":"https://api.github.com/repos/grosser/rails/languages","stargazers_url":"https://api.github.com/repos/grosser/rails/stargazers","contributors_url":"https://api.github.com/repos/grosser/rails/contributors","subscribers_url":"https://api.github.com/repos/grosser/rails/subscribers","subscription_url":"https://api.github.com/repos/grosser/rails/subscription","commits_url":"https://api.github.com/repos/grosser/rails/commits{/sha}","git_commits_url":"https://api.github.com/repos/grosser/rails/git/commits{/sha}","comments_url":"https://api.github.com/repos/grosser/rails/comments{/number}","issue_comment_url":"https://api.github.com/repos/grosser/rails/issues/comments{/number}","contents_url":"https://api.github.com/repos/grosser/rails/contents/{+path}","compare_url":"https://api.github.com/repos/grosser/rails/compare/{base}...{head}","merges_url":"https://api.github.com/repos/grosser/rails/merges","archive_url":"https://api.github.com/repos/grosser/rails/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/grosser/rails/downloads","issues_url":"https://api.github.com/repos/grosser/rails/issues{/number}","pulls_url":"https://api.github.com/repos/grosser/rails/pulls{/number}","milestones_url":"https://api.github.com/repos/grosser/rails/milestones{/number}","notifications_url":"https://api.github.com/repos/grosser/rails/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/grosser/rails/labels{/name}","releases_url":"https://api.github.com/repos/grosser/rails/releases{/id}","created_at":"2012-05-10T14:40:14Z","updated_at":"2015-03-10T00:47:35Z","pushed_at":"2015-11-16T21:59:04Z","git_url":"git://github.com/grosser/rails.git","ssh_url":"git@github.com:grosser/rails.git","clone_url":"https://github.com/grosser/rails.git","svn_url":"https://github.com/grosser/rails","homepage":"http://rubyonrails.org","size":107134,"stargazers_count":1,"watchers_count":1,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":0,"forks":2,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"rails:master","ref":"master","sha":"5388464af6ec229ddf3a1040cd7466f45370cedd","user":{"login":"rails","id":4223,"avatar_url":"https://avatars.githubusercontent.com/u/4223?v=3","gravatar_id":"","url":"https://api.github.com/users/rails","html_url":"https://github.com/rails","followers_url":"https://api.github.com/users/rails/followers","following_url":"https://api.github.com/users/rails/following{/other_user}","gists_url":"https://api.github.com/users/rails/gists{/gist_id}","starred_url":"https://api.github.com/users/rails/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rails/subscriptions","organizations_url":"https://api.github.com/users/rails/orgs","repos_url":"https://api.github.com/users/rails/repos","events_url":"https://api.github.com/users/rails/events{/privacy}","received_events_url":"https://api.github.com/users/rails/received_events","type":"Organization","site_admin":false},"repo":{"id":8514,"name":"rails","full_name":"rails/rails","owner":{"login":"rails","id":4223,"avatar_url":"https://avatars.githubusercontent.com/u/4223?v=3","gravatar_id":"","url":"https://api.github.com/users/rails","html_url":"https://github.com/rails","followers_url":"https://api.github.com/users/rails/followers","following_url":"https://api.github.com/users/rails/following{/other_user}","gists_url":"https://api.github.com/users/rails/gists{/gist_id}","starred_url":"https://api.github.com/users/rails/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rails/subscriptions","organizations_url":"https://api.github.com/users/rails/orgs","repos_url":"https://api.github.com/users/rails/repos","events_url":"https://api.github.com/users/rails/events{/privacy}","received_events_url":"https://api.github.com/users/rails/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/rails/rails","description":"Ruby on Rails","fork":false,"url":"https://api.github.com/repos/rails/rails","forks_url":"https://api.github.com/repos/rails/rails/forks","keys_url":"https://api.github.com/repos/rails/rails/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rails/rails/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rails/rails/teams","hooks_url":"https://api.github.com/repos/rails/rails/hooks","issue_events_url":"https://api.github.com/repos/rails/rails/issues/events{/number}","events_url":"https://api.github.com/repos/rails/rails/events","assignees_url":"https://api.github.com/repos/rails/rails/assignees{/user}","branches_url":"https://api.github.com/repos/rails/rails/branches{/branch}","tags_url":"https://api.github.com/repos/rails/rails/tags","blobs_url":"https://api.github.com/repos/rails/rails/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rails/rails/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rails/rails/git/refs{/sha}","trees_url":"https://api.github.com/repos/rails/rails/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rails/rails/statuses/{sha}","languages_url":"https://api.github.com/repos/rails/rails/languages","stargazers_url":"https://api.github.com/repos/rails/rails/stargazers","contributors_url":"https://api.github.com/repos/rails/rails/contributors","subscribers_url":"https://api.github.com/repos/rails/rails/subscribers","subscription_url":"https://api.github.com/repos/rails/rails/subscription","commits_url":"https://api.github.com/repos/rails/rails/commits{/sha}","git_commits_url":"https://api.github.com/repos/rails/rails/git/commits{/sha}","comments_url":"https://api.github.com/repos/rails/rails/comments{/number}","issue_comment_url":"https://api.github.com/repos/rails/rails/issues/comments{/number}","contents_url":"https://api.github.com/repos/rails/rails/contents/{+path}","compare_url":"https://api.github.com/repos/rails/rails/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rails/rails/merges","archive_url":"https://api.github.com/repos/rails/rails/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rails/rails/downloads","issues_url":"https://api.github.com/repos/rails/rails/issues{/number}","pulls_url":"https://api.github.com/repos/rails/rails/pulls{/number}","milestones_url":"https://api.github.com/repos/rails/rails/milestones{/number}","notifications_url":"https://api.github.com/repos/rails/rails/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rails/rails/labels{/name}","releases_url":"https://api.github.com/repos/rails/rails/releases{/id}","created_at":"2008-04-11T02:19:47Z","updated_at":"2015-11-18T16:52:08Z","pushed_at":"2015-11-18T16:40:09Z","git_url":"git://github.com/rails/rails.git","ssh_url":"git@github.com:rails/rails.git","clone_url":"https://github.com/rails/rails.git","svn_url":"https://github.com/rails/rails","homepage":"http://rubyonrails.org","size":322050,"stargazers_count":28433,"watchers_count":28433,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":11491,"mirror_url":null,"open_issues_count":864,"forks":11491,"open_issues":864,"watchers":28433,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rails/rails/pulls/22215"},"html":{"href":"https://github.com/rails/rails/pull/22215"},"issue":{"href":"https://api.github.com/repos/rails/rails/issues/22215"},"comments":{"href":"https://api.github.com/repos/rails/rails/issues/22215/comments"},"review_comments":{"href":"https://api.github.com/repos/rails/rails/pulls/22215/comments"},"review_comment":{"href":"https://api.github.com/repos/rails/rails/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/rails/rails/pulls/22215/commits"},"statuses":{"href":"https://api.github.com/repos/rails/rails/statuses/f6bc5acf1006ef4c6cac03aee4b76d62e54465d4"}}}}