{"action":"created","comment":{"url":"https://api.github.com/repos/Shopify/identity_cache/pulls/comments/23163291","id":23163291,"diff_hunk":"@@ -270,23 +270,19 @@ def attribute_dynamic_fetcher(attribute, fields, values) #:nodoc:\n \n       def add_parent_expiry_hook(options)\n         child_class = options[:association_class]\n-        child_association = child_class.reflect_on_association(options[:inverse_name])\n-        raise InverseAssociationError unless child_association\n-        foreign_key = child_association.association_foreign_key\n+        raise InverseAssociationError unless child_class.reflect_on_association(options[:inverse_name])\n \n         child_class.send(:include, ArTransactionChanges) unless child_class.include?(ArTransactionChanges)\n         child_class.send(:include, ParentModelExpiration) unless child_class.include?(ParentModelExpiration)\n \n         after_action_name = \"expire_parent_cache_#{self.name.underscore}\"","path":"lib/identity_cache/configuration_dsl.rb","position":12,"original_position":12,"commit_id":"5bb73554da77ed20cdefd4c720b72dfa882bd3c2","original_commit_id":"5bb73554da77ed20cdefd4c720b72dfa882bd3c2","user":{"login":"tjoyal","id":207902,"avatar_url":"https://avatars.githubusercontent.com/u/207902?v=3","gravatar_id":"","url":"https://api.github.com/users/tjoyal","html_url":"https://github.com/tjoyal","followers_url":"https://api.github.com/users/tjoyal/followers","following_url":"https://api.github.com/users/tjoyal/following{/other_user}","gists_url":"https://api.github.com/users/tjoyal/gists{/gist_id}","starred_url":"https://api.github.com/users/tjoyal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tjoyal/subscriptions","organizations_url":"https://api.github.com/users/tjoyal/orgs","repos_url":"https://api.github.com/users/tjoyal/repos","events_url":"https://api.github.com/users/tjoyal/events{/privacy}","received_events_url":"https://api.github.com/users/tjoyal/received_events","type":"User","site_admin":false},"body":"No longer used","created_at":"2015-01-19T14:44:27Z","updated_at":"2015-01-19T14:44:27Z","html_url":"https://github.com/Shopify/identity_cache/pull/199#discussion_r23163291","pull_request_url":"https://api.github.com/repos/Shopify/identity_cache/pulls/199","_links":{"self":{"href":"https://api.github.com/repos/Shopify/identity_cache/pulls/comments/23163291"},"html":{"href":"https://github.com/Shopify/identity_cache/pull/199#discussion_r23163291"},"pull_request":{"href":"https://api.github.com/repos/Shopify/identity_cache/pulls/199"}}},"pull_request":{"url":"https://api.github.com/repos/Shopify/identity_cache/pulls/199","id":27550548,"html_url":"https://github.com/Shopify/identity_cache/pull/199","diff_url":"https://github.com/Shopify/identity_cache/pull/199.diff","patch_url":"https://github.com/Shopify/identity_cache/pull/199.patch","issue_url":"https://api.github.com/repos/Shopify/identity_cache/issues/199","number":199,"state":"open","locked":false,"title":"Refactor and deduplicate parent cache expiry.","user":{"login":"dylanahsmith","id":954402,"avatar_url":"https://avatars.githubusercontent.com/u/954402?v=3","gravatar_id":"","url":"https://api.github.com/users/dylanahsmith","html_url":"https://github.com/dylanahsmith","followers_url":"https://api.github.com/users/dylanahsmith/followers","following_url":"https://api.github.com/users/dylanahsmith/following{/other_user}","gists_url":"https://api.github.com/users/dylanahsmith/gists{/gist_id}","starred_url":"https://api.github.com/users/dylanahsmith/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dylanahsmith/subscriptions","organizations_url":"https://api.github.com/users/dylanahsmith/orgs","repos_url":"https://api.github.com/users/dylanahsmith/repos","events_url":"https://api.github.com/users/dylanahsmith/events{/privacy}","received_events_url":"https://api.github.com/users/dylanahsmith/received_events","type":"User","site_admin":false},"body":"@BlakeMesdag & @tjoyal for review\r\n\r\n## Problem\r\n\r\nWe noticed redundant memcache delete requests after pull #184 was introduced.  It looks like this happens when a record embeds a cache blob more than once.\r\n\r\n## Solution\r\n\r\nWhen a child expires its parent caches, it first builds up a complete set of all the records that need their cache invalidated, then expires the cache on those records.  A hash is used to implement this set, and the primary cache key is used as a key, so it will avoid adding multiple records to the set for the same database row, even if there are multiple record instances for that row in memory.","created_at":"2015-01-17T02:31:57Z","updated_at":"2015-01-19T14:44:27Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b6e957d42f05e52a68d29a405ab0be7c452753e1","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Shopify/identity_cache/pulls/199/commits","review_comments_url":"https://api.github.com/repos/Shopify/identity_cache/pulls/199/comments","review_comment_url":"https://api.github.com/repos/Shopify/identity_cache/pulls/comments/{number}","comments_url":"https://api.github.com/repos/Shopify/identity_cache/issues/199/comments","statuses_url":"https://api.github.com/repos/Shopify/identity_cache/statuses/5bb73554da77ed20cdefd4c720b72dfa882bd3c2","head":{"label":"Shopify:dedup-parent-cache-expiry","ref":"dedup-parent-cache-expiry","sha":"5bb73554da77ed20cdefd4c720b72dfa882bd3c2","user":{"login":"Shopify","id":8085,"avatar_url":"https://avatars.githubusercontent.com/u/8085?v=3","gravatar_id":"","url":"https://api.github.com/users/Shopify","html_url":"https://github.com/Shopify","followers_url":"https://api.github.com/users/Shopify/followers","following_url":"https://api.github.com/users/Shopify/following{/other_user}","gists_url":"https://api.github.com/users/Shopify/gists{/gist_id}","starred_url":"https://api.github.com/users/Shopify/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Shopify/subscriptions","organizations_url":"https://api.github.com/users/Shopify/orgs","repos_url":"https://api.github.com/users/Shopify/repos","events_url":"https://api.github.com/users/Shopify/events{/privacy}","received_events_url":"https://api.github.com/users/Shopify/received_events","type":"Organization","site_admin":false},"repo":{"id":8472417,"name":"identity_cache","full_name":"Shopify/identity_cache","owner":{"login":"Shopify","id":8085,"avatar_url":"https://avatars.githubusercontent.com/u/8085?v=3","gravatar_id":"","url":"https://api.github.com/users/Shopify","html_url":"https://github.com/Shopify","followers_url":"https://api.github.com/users/Shopify/followers","following_url":"https://api.github.com/users/Shopify/following{/other_user}","gists_url":"https://api.github.com/users/Shopify/gists{/gist_id}","starred_url":"https://api.github.com/users/Shopify/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Shopify/subscriptions","organizations_url":"https://api.github.com/users/Shopify/orgs","repos_url":"https://api.github.com/users/Shopify/repos","events_url":"https://api.github.com/users/Shopify/events{/privacy}","received_events_url":"https://api.github.com/users/Shopify/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Shopify/identity_cache","description":"IdentityCache is a blob level caching solution to plug into ActiveRecord. Don't #find, #fetch!","fork":false,"url":"https://api.github.com/repos/Shopify/identity_cache","forks_url":"https://api.github.com/repos/Shopify/identity_cache/forks","keys_url":"https://api.github.com/repos/Shopify/identity_cache/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Shopify/identity_cache/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Shopify/identity_cache/teams","hooks_url":"https://api.github.com/repos/Shopify/identity_cache/hooks","issue_events_url":"https://api.github.com/repos/Shopify/identity_cache/issues/events{/number}","events_url":"https://api.github.com/repos/Shopify/identity_cache/events","assignees_url":"https://api.github.com/repos/Shopify/identity_cache/assignees{/user}","branches_url":"https://api.github.com/repos/Shopify/identity_cache/branches{/branch}","tags_url":"https://api.github.com/repos/Shopify/identity_cache/tags","blobs_url":"https://api.github.com/repos/Shopify/identity_cache/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Shopify/identity_cache/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Shopify/identity_cache/git/refs{/sha}","trees_url":"https://api.github.com/repos/Shopify/identity_cache/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Shopify/identity_cache/statuses/{sha}","languages_url":"https://api.github.com/repos/Shopify/identity_cache/languages","stargazers_url":"https://api.github.com/repos/Shopify/identity_cache/stargazers","contributors_url":"https://api.github.com/repos/Shopify/identity_cache/contributors","subscribers_url":"https://api.github.com/repos/Shopify/identity_cache/subscribers","subscription_url":"https://api.github.com/repos/Shopify/identity_cache/subscription","commits_url":"https://api.github.com/repos/Shopify/identity_cache/commits{/sha}","git_commits_url":"https://api.github.com/repos/Shopify/identity_cache/git/commits{/sha}","comments_url":"https://api.github.com/repos/Shopify/identity_cache/comments{/number}","issue_comment_url":"https://api.github.com/repos/Shopify/identity_cache/issues/comments/{number}","contents_url":"https://api.github.com/repos/Shopify/identity_cache/contents/{+path}","compare_url":"https://api.github.com/repos/Shopify/identity_cache/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Shopify/identity_cache/merges","archive_url":"https://api.github.com/repos/Shopify/identity_cache/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Shopify/identity_cache/downloads","issues_url":"https://api.github.com/repos/Shopify/identity_cache/issues{/number}","pulls_url":"https://api.github.com/repos/Shopify/identity_cache/pulls{/number}","milestones_url":"https://api.github.com/repos/Shopify/identity_cache/milestones{/number}","notifications_url":"https://api.github.com/repos/Shopify/identity_cache/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Shopify/identity_cache/labels{/name}","releases_url":"https://api.github.com/repos/Shopify/identity_cache/releases{/id}","created_at":"2013-02-28T05:19:14Z","updated_at":"2015-01-19T04:51:51Z","pushed_at":"2015-01-17T04:11:16Z","git_url":"git://github.com/Shopify/identity_cache.git","ssh_url":"git@github.com:Shopify/identity_cache.git","clone_url":"https://github.com/Shopify/identity_cache.git","svn_url":"https://github.com/Shopify/identity_cache","homepage":"http://shopify.github.io/identity_cache","size":2537,"stargazers_count":896,"watchers_count":896,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":99,"mirror_url":null,"open_issues_count":24,"forks":99,"open_issues":24,"watchers":896,"default_branch":"master"}},"base":{"label":"Shopify:master","ref":"master","sha":"1abbfcb007bc2d5a193e93a8cf7bbbdf9b219a71","user":{"login":"Shopify","id":8085,"avatar_url":"https://avatars.githubusercontent.com/u/8085?v=3","gravatar_id":"","url":"https://api.github.com/users/Shopify","html_url":"https://github.com/Shopify","followers_url":"https://api.github.com/users/Shopify/followers","following_url":"https://api.github.com/users/Shopify/following{/other_user}","gists_url":"https://api.github.com/users/Shopify/gists{/gist_id}","starred_url":"https://api.github.com/users/Shopify/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Shopify/subscriptions","organizations_url":"https://api.github.com/users/Shopify/orgs","repos_url":"https://api.github.com/users/Shopify/repos","events_url":"https://api.github.com/users/Shopify/events{/privacy}","received_events_url":"https://api.github.com/users/Shopify/received_events","type":"Organization","site_admin":false},"repo":{"id":8472417,"name":"identity_cache","full_name":"Shopify/identity_cache","owner":{"login":"Shopify","id":8085,"avatar_url":"https://avatars.githubusercontent.com/u/8085?v=3","gravatar_id":"","url":"https://api.github.com/users/Shopify","html_url":"https://github.com/Shopify","followers_url":"https://api.github.com/users/Shopify/followers","following_url":"https://api.github.com/users/Shopify/following{/other_user}","gists_url":"https://api.github.com/users/Shopify/gists{/gist_id}","starred_url":"https://api.github.com/users/Shopify/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Shopify/subscriptions","organizations_url":"https://api.github.com/users/Shopify/orgs","repos_url":"https://api.github.com/users/Shopify/repos","events_url":"https://api.github.com/users/Shopify/events{/privacy}","received_events_url":"https://api.github.com/users/Shopify/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Shopify/identity_cache","description":"IdentityCache is a blob level caching solution to plug into ActiveRecord. Don't #find, #fetch!","fork":false,"url":"https://api.github.com/repos/Shopify/identity_cache","forks_url":"https://api.github.com/repos/Shopify/identity_cache/forks","keys_url":"https://api.github.com/repos/Shopify/identity_cache/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Shopify/identity_cache/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Shopify/identity_cache/teams","hooks_url":"https://api.github.com/repos/Shopify/identity_cache/hooks","issue_events_url":"https://api.github.com/repos/Shopify/identity_cache/issues/events{/number}","events_url":"https://api.github.com/repos/Shopify/identity_cache/events","assignees_url":"https://api.github.com/repos/Shopify/identity_cache/assignees{/user}","branches_url":"https://api.github.com/repos/Shopify/identity_cache/branches{/branch}","tags_url":"https://api.github.com/repos/Shopify/identity_cache/tags","blobs_url":"https://api.github.com/repos/Shopify/identity_cache/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Shopify/identity_cache/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Shopify/identity_cache/git/refs{/sha}","trees_url":"https://api.github.com/repos/Shopify/identity_cache/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Shopify/identity_cache/statuses/{sha}","languages_url":"https://api.github.com/repos/Shopify/identity_cache/languages","stargazers_url":"https://api.github.com/repos/Shopify/identity_cache/stargazers","contributors_url":"https://api.github.com/repos/Shopify/identity_cache/contributors","subscribers_url":"https://api.github.com/repos/Shopify/identity_cache/subscribers","subscription_url":"https://api.github.com/repos/Shopify/identity_cache/subscription","commits_url":"https://api.github.com/repos/Shopify/identity_cache/commits{/sha}","git_commits_url":"https://api.github.com/repos/Shopify/identity_cache/git/commits{/sha}","comments_url":"https://api.github.com/repos/Shopify/identity_cache/comments{/number}","issue_comment_url":"https://api.github.com/repos/Shopify/identity_cache/issues/comments/{number}","contents_url":"https://api.github.com/repos/Shopify/identity_cache/contents/{+path}","compare_url":"https://api.github.com/repos/Shopify/identity_cache/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Shopify/identity_cache/merges","archive_url":"https://api.github.com/repos/Shopify/identity_cache/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Shopify/identity_cache/downloads","issues_url":"https://api.github.com/repos/Shopify/identity_cache/issues{/number}","pulls_url":"https://api.github.com/repos/Shopify/identity_cache/pulls{/number}","milestones_url":"https://api.github.com/repos/Shopify/identity_cache/milestones{/number}","notifications_url":"https://api.github.com/repos/Shopify/identity_cache/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Shopify/identity_cache/labels{/name}","releases_url":"https://api.github.com/repos/Shopify/identity_cache/releases{/id}","created_at":"2013-02-28T05:19:14Z","updated_at":"2015-01-19T04:51:51Z","pushed_at":"2015-01-17T04:11:16Z","git_url":"git://github.com/Shopify/identity_cache.git","ssh_url":"git@github.com:Shopify/identity_cache.git","clone_url":"https://github.com/Shopify/identity_cache.git","svn_url":"https://github.com/Shopify/identity_cache","homepage":"http://shopify.github.io/identity_cache","size":2537,"stargazers_count":896,"watchers_count":896,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":99,"mirror_url":null,"open_issues_count":24,"forks":99,"open_issues":24,"watchers":896,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Shopify/identity_cache/pulls/199"},"html":{"href":"https://github.com/Shopify/identity_cache/pull/199"},"issue":{"href":"https://api.github.com/repos/Shopify/identity_cache/issues/199"},"comments":{"href":"https://api.github.com/repos/Shopify/identity_cache/issues/199/comments"},"review_comments":{"href":"https://api.github.com/repos/Shopify/identity_cache/pulls/199/comments"},"review_comment":{"href":"https://api.github.com/repos/Shopify/identity_cache/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/Shopify/identity_cache/pulls/199/commits"},"statuses":{"href":"https://api.github.com/repos/Shopify/identity_cache/statuses/5bb73554da77ed20cdefd4c720b72dfa882bd3c2"}}}}