{"action":"created","comment":{"url":"https://api.github.com/repos/sul-dlss/preservation_catalog/pulls/comments/197493813","pull_request_review_id":131254477,"id":197493813,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5NzQ5MzgxMw==","diff_hunk":"@@ -54,63 +52,40 @@\n         archive_policy: Config::Options.new(archive_ttl: 666, fixity_ttl: 666)\n       )\n       allow(Settings.preservation_policies).to receive(:policy_definitions).and_return(archive_pres_policy_setting)\n-      PreservationPolicy.seed_from_config\n-      expect(PreservationPolicy.find_by(preservation_policy_name: 'archive_policy')).to be_a_kind_of PreservationPolicy\n+      described_class.seed_from_config\n+      expect(described_class.find_by(preservation_policy_name: 'archive_policy')).to be_a_kind_of described_class\n     end\n   end\n \n   describe '.default_policy' do\n+    # clear the cache before each test (and after all) to reset\n+    before { described_class.default_policy = nil }\n+    after(:all) { described_class.default_policy = nil }\n+\n     it 'returns the default preservation policy object' do\n       # db already seeded\n-      expect(PreservationPolicy.default_policy).to be_a_kind_of PreservationPolicy\n+      expect(described_class.default_policy).to be_a_kind_of described_class\n     end\n \n     it \"raises RecordNotFound if the default policy doesn't exist in the db\" do\n-      # a bit contrived, but just want to test that lack of default PreservationPolicy causes lookup to\n+      # a bit contrived, but just want to test that lack of default described_class causes lookup to","path":"spec/models/preservation_policy_spec.rb","position":78,"original_position":78,"commit_id":"6857d8c18cefbe0e7366e1321e44325f5a50aeb1","original_commit_id":"6857d8c18cefbe0e7366e1321e44325f5a50aeb1","user":{"login":"ndushay","id":96775,"node_id":"MDQ6VXNlcjk2Nzc1","avatar_url":"https://avatars0.githubusercontent.com/u/96775?v=4","gravatar_id":"","url":"https://api.github.com/users/ndushay","html_url":"https://github.com/ndushay","followers_url":"https://api.github.com/users/ndushay/followers","following_url":"https://api.github.com/users/ndushay/following{/other_user}","gists_url":"https://api.github.com/users/ndushay/gists{/gist_id}","starred_url":"https://api.github.com/users/ndushay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ndushay/subscriptions","organizations_url":"https://api.github.com/users/ndushay/orgs","repos_url":"https://api.github.com/users/ndushay/repos","events_url":"https://api.github.com/users/ndushay/events{/privacy}","received_events_url":"https://api.github.com/users/ndushay/received_events","type":"User","site_admin":false},"body":"this comment is the one place where keeping PreservationPolicy as the string might read better","created_at":"2018-06-22T16:06:05Z","updated_at":"2018-06-22T16:07:17Z","html_url":"https://github.com/sul-dlss/preservation_catalog/pull/923#discussion_r197493813","pull_request_url":"https://api.github.com/repos/sul-dlss/preservation_catalog/pulls/923","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/sul-dlss/preservation_catalog/pulls/comments/197493813"},"html":{"href":"https://github.com/sul-dlss/preservation_catalog/pull/923#discussion_r197493813"},"pull_request":{"href":"https://api.github.com/repos/sul-dlss/preservation_catalog/pulls/923"}}},"pull_request":{"url":"https://api.github.com/repos/sul-dlss/preservation_catalog/pulls/923","id":196615091,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk2NjE1MDkx","html_url":"https://github.com/sul-dlss/preservation_catalog/pull/923","diff_url":"https://github.com/sul-dlss/preservation_catalog/pull/923.diff","patch_url":"https://github.com/sul-dlss/preservation_catalog/pull/923.patch","issue_url":"https://api.github.com/repos/sul-dlss/preservation_catalog/issues/923","number":923,"state":"open","locked":false,"title":"Cache at the right level in PreservationPolicy","user":{"login":"atz","id":109954,"node_id":"MDQ6VXNlcjEwOTk1NA==","avatar_url":"https://avatars2.githubusercontent.com/u/109954?v=4","gravatar_id":"","url":"https://api.github.com/users/atz","html_url":"https://github.com/atz","followers_url":"https://api.github.com/users/atz/followers","following_url":"https://api.github.com/users/atz/following{/other_user}","gists_url":"https://api.github.com/users/atz/gists{/gist_id}","starred_url":"https://api.github.com/users/atz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/atz/subscriptions","organizations_url":"https://api.github.com/users/atz/orgs","repos_url":"https://api.github.com/users/atz/repos","events_url":"https://api.github.com/users/atz/events{/privacy}","received_events_url":"https://api.github.com/users/atz/received_events","type":"User","site_admin":false},"body":"The valuable piece is the default policy, not (just) its ID. This requires nothing special (i.e. no special cache hash and clearing methods) and makes the model easier to use.\r\n\r\nI moved the salient cache-behavior tests into the `. default_policy` block to ensure we still enjoy those benefits.\r\n\r\nEverywhere that used to call `default_policy_id` can and should call `default_policy.id`.","created_at":"2018-06-22T01:14:12Z","updated_at":"2018-06-22T16:07:17Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c94082dd1b609087a15827467206c6407dc54693","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":719133329,"node_id":"MDU6TGFiZWw3MTkxMzMzMjk=","url":"https://api.github.com/repos/sul-dlss/preservation_catalog/labels/needs%20review","name":"needs review","color":"e6e6e6","default":false},{"id":709763140,"node_id":"MDU6TGFiZWw3MDk3NjMxNDA=","url":"https://api.github.com/repos/sul-dlss/preservation_catalog/labels/refactor","name":"refactor","color":"c2e0c6","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/sul-dlss/preservation_catalog/pulls/923/commits","review_comments_url":"https://api.github.com/repos/sul-dlss/preservation_catalog/pulls/923/comments","review_comment_url":"https://api.github.com/repos/sul-dlss/preservation_catalog/pulls/comments{/number}","comments_url":"https://api.github.com/repos/sul-dlss/preservation_catalog/issues/923/comments","statuses_url":"https://api.github.com/repos/sul-dlss/preservation_catalog/statuses/6857d8c18cefbe0e7366e1321e44325f5a50aeb1","head":{"label":"sul-dlss:policy_cache","ref":"policy_cache","sha":"6857d8c18cefbe0e7366e1321e44325f5a50aeb1","user":{"login":"sul-dlss","id":230583,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIzMDU4Mw==","avatar_url":"https://avatars1.githubusercontent.com/u/230583?v=4","gravatar_id":"","url":"https://api.github.com/users/sul-dlss","html_url":"https://github.com/sul-dlss","followers_url":"https://api.github.com/users/sul-dlss/followers","following_url":"https://api.github.com/users/sul-dlss/following{/other_user}","gists_url":"https://api.github.com/users/sul-dlss/gists{/gist_id}","starred_url":"https://api.github.com/users/sul-dlss/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sul-dlss/subscriptions","organizations_url":"https://api.github.com/users/sul-dlss/orgs","repos_url":"https://api.github.com/users/sul-dlss/repos","events_url":"https://api.github.com/users/sul-dlss/events{/privacy}","received_events_url":"https://api.github.com/users/sul-dlss/received_events","type":"Organization","site_admin":false},"repo":{"id":100517453,"node_id":"MDEwOlJlcG9zaXRvcnkxMDA1MTc0NTM=","name":"preservation_catalog","full_name":"sul-dlss/preservation_catalog","owner":{"login":"sul-dlss","id":230583,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIzMDU4Mw==","avatar_url":"https://avatars1.githubusercontent.com/u/230583?v=4","gravatar_id":"","url":"https://api.github.com/users/sul-dlss","html_url":"https://github.com/sul-dlss","followers_url":"https://api.github.com/users/sul-dlss/followers","following_url":"https://api.github.com/users/sul-dlss/following{/other_user}","gists_url":"https://api.github.com/users/sul-dlss/gists{/gist_id}","starred_url":"https://api.github.com/users/sul-dlss/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sul-dlss/subscriptions","organizations_url":"https://api.github.com/users/sul-dlss/orgs","repos_url":"https://api.github.com/users/sul-dlss/repos","events_url":"https://api.github.com/users/sul-dlss/events{/privacy}","received_events_url":"https://api.github.com/users/sul-dlss/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/sul-dlss/preservation_catalog","description":"Rails application to track, audit and replicate archival artifacts associated with SDR objects.","fork":false,"url":"https://api.github.com/repos/sul-dlss/preservation_catalog","forks_url":"https://api.github.com/repos/sul-dlss/preservation_catalog/forks","keys_url":"https://api.github.com/repos/sul-dlss/preservation_catalog/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sul-dlss/preservation_catalog/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sul-dlss/preservation_catalog/teams","hooks_url":"https://api.github.com/repos/sul-dlss/preservation_catalog/hooks","issue_events_url":"https://api.github.com/repos/sul-dlss/preservation_catalog/issues/events{/number}","events_url":"https://api.github.com/repos/sul-dlss/preservation_catalog/events","assignees_url":"https://api.github.com/repos/sul-dlss/preservation_catalog/assignees{/user}","branches_url":"https://api.github.com/repos/sul-dlss/preservation_catalog/branches{/branch}","tags_url":"https://api.github.com/repos/sul-dlss/preservation_catalog/tags","blobs_url":"https://api.github.com/repos/sul-dlss/preservation_catalog/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sul-dlss/preservation_catalog/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sul-dlss/preservation_catalog/git/refs{/sha}","trees_url":"https://api.github.com/repos/sul-dlss/preservation_catalog/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sul-dlss/preservation_catalog/statuses/{sha}","languages_url":"https://api.github.com/repos/sul-dlss/preservation_catalog/languages","stargazers_url":"https://api.github.com/repos/sul-dlss/preservation_catalog/stargazers","contributors_url":"https://api.github.com/repos/sul-dlss/preservation_catalog/contributors","subscribers_url":"https://api.github.com/repos/sul-dlss/preservation_catalog/subscribers","subscription_url":"https://api.github.com/repos/sul-dlss/preservation_catalog/subscription","commits_url":"https://api.github.com/repos/sul-dlss/preservation_catalog/commits{/sha}","git_commits_url":"https://api.github.com/repos/sul-dlss/preservation_catalog/git/commits{/sha}","comments_url":"https://api.github.com/repos/sul-dlss/preservation_catalog/comments{/number}","issue_comment_url":"https://api.github.com/repos/sul-dlss/preservation_catalog/issues/comments{/number}","contents_url":"https://api.github.com/repos/sul-dlss/preservation_catalog/contents/{+path}","compare_url":"https://api.github.com/repos/sul-dlss/preservation_catalog/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sul-dlss/preservation_catalog/merges","archive_url":"https://api.github.com/repos/sul-dlss/preservation_catalog/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sul-dlss/preservation_catalog/downloads","issues_url":"https://api.github.com/repos/sul-dlss/preservation_catalog/issues{/number}","pulls_url":"https://api.github.com/repos/sul-dlss/preservation_catalog/pulls{/number}","milestones_url":"https://api.github.com/repos/sul-dlss/preservation_catalog/milestones{/number}","notifications_url":"https://api.github.com/repos/sul-dlss/preservation_catalog/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sul-dlss/preservation_catalog/labels{/name}","releases_url":"https://api.github.com/repos/sul-dlss/preservation_catalog/releases{/id}","deployments_url":"https://api.github.com/repos/sul-dlss/preservation_catalog/deployments","created_at":"2017-08-16T17:55:52Z","updated_at":"2018-06-22T01:19:45Z","pushed_at":"2018-06-22T02:57:08Z","git_url":"git://github.com/sul-dlss/preservation_catalog.git","ssh_url":"git@github.com:sul-dlss/preservation_catalog.git","clone_url":"https://github.com/sul-dlss/preservation_catalog.git","svn_url":"https://github.com/sul-dlss/preservation_catalog","homepage":"","size":271766,"stargazers_count":1,"watchers_count":1,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":96,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":1,"open_issues":96,"watchers":1,"default_branch":"master"}},"base":{"label":"sul-dlss:master","ref":"master","sha":"5bf969e5368f1803aab4c485aa3b4286e6f2d76d","user":{"login":"sul-dlss","id":230583,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIzMDU4Mw==","avatar_url":"https://avatars1.githubusercontent.com/u/230583?v=4","gravatar_id":"","url":"https://api.github.com/users/sul-dlss","html_url":"https://github.com/sul-dlss","followers_url":"https://api.github.com/users/sul-dlss/followers","following_url":"https://api.github.com/users/sul-dlss/following{/other_user}","gists_url":"https://api.github.com/users/sul-dlss/gists{/gist_id}","starred_url":"https://api.github.com/users/sul-dlss/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sul-dlss/subscriptions","organizations_url":"https://api.github.com/users/sul-dlss/orgs","repos_url":"https://api.github.com/users/sul-dlss/repos","events_url":"https://api.github.com/users/sul-dlss/events{/privacy}","received_events_url":"https://api.github.com/users/sul-dlss/received_events","type":"Organization","site_admin":false},"repo":{"id":100517453,"node_id":"MDEwOlJlcG9zaXRvcnkxMDA1MTc0NTM=","name":"preservation_catalog","full_name":"sul-dlss/preservation_catalog","owner":{"login":"sul-dlss","id":230583,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIzMDU4Mw==","avatar_url":"https://avatars1.githubusercontent.com/u/230583?v=4","gravatar_id":"","url":"https://api.github.com/users/sul-dlss","html_url":"https://github.com/sul-dlss","followers_url":"https://api.github.com/users/sul-dlss/followers","following_url":"https://api.github.com/users/sul-dlss/following{/other_user}","gists_url":"https://api.github.com/users/sul-dlss/gists{/gist_id}","starred_url":"https://api.github.com/users/sul-dlss/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sul-dlss/subscriptions","organizations_url":"https://api.github.com/users/sul-dlss/orgs","repos_url":"https://api.github.com/users/sul-dlss/repos","events_url":"https://api.github.com/users/sul-dlss/events{/privacy}","received_events_url":"https://api.github.com/users/sul-dlss/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/sul-dlss/preservation_catalog","description":"Rails application to track, audit and replicate archival artifacts associated with SDR objects.","fork":false,"url":"https://api.github.com/repos/sul-dlss/preservation_catalog","forks_url":"https://api.github.com/repos/sul-dlss/preservation_catalog/forks","keys_url":"https://api.github.com/repos/sul-dlss/preservation_catalog/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sul-dlss/preservation_catalog/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sul-dlss/preservation_catalog/teams","hooks_url":"https://api.github.com/repos/sul-dlss/preservation_catalog/hooks","issue_events_url":"https://api.github.com/repos/sul-dlss/preservation_catalog/issues/events{/number}","events_url":"https://api.github.com/repos/sul-dlss/preservation_catalog/events","assignees_url":"https://api.github.com/repos/sul-dlss/preservation_catalog/assignees{/user}","branches_url":"https://api.github.com/repos/sul-dlss/preservation_catalog/branches{/branch}","tags_url":"https://api.github.com/repos/sul-dlss/preservation_catalog/tags","blobs_url":"https://api.github.com/repos/sul-dlss/preservation_catalog/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sul-dlss/preservation_catalog/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sul-dlss/preservation_catalog/git/refs{/sha}","trees_url":"https://api.github.com/repos/sul-dlss/preservation_catalog/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sul-dlss/preservation_catalog/statuses/{sha}","languages_url":"https://api.github.com/repos/sul-dlss/preservation_catalog/languages","stargazers_url":"https://api.github.com/repos/sul-dlss/preservation_catalog/stargazers","contributors_url":"https://api.github.com/repos/sul-dlss/preservation_catalog/contributors","subscribers_url":"https://api.github.com/repos/sul-dlss/preservation_catalog/subscribers","subscription_url":"https://api.github.com/repos/sul-dlss/preservation_catalog/subscription","commits_url":"https://api.github.com/repos/sul-dlss/preservation_catalog/commits{/sha}","git_commits_url":"https://api.github.com/repos/sul-dlss/preservation_catalog/git/commits{/sha}","comments_url":"https://api.github.com/repos/sul-dlss/preservation_catalog/comments{/number}","issue_comment_url":"https://api.github.com/repos/sul-dlss/preservation_catalog/issues/comments{/number}","contents_url":"https://api.github.com/repos/sul-dlss/preservation_catalog/contents/{+path}","compare_url":"https://api.github.com/repos/sul-dlss/preservation_catalog/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sul-dlss/preservation_catalog/merges","archive_url":"https://api.github.com/repos/sul-dlss/preservation_catalog/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sul-dlss/preservation_catalog/downloads","issues_url":"https://api.github.com/repos/sul-dlss/preservation_catalog/issues{/number}","pulls_url":"https://api.github.com/repos/sul-dlss/preservation_catalog/pulls{/number}","milestones_url":"https://api.github.com/repos/sul-dlss/preservation_catalog/milestones{/number}","notifications_url":"https://api.github.com/repos/sul-dlss/preservation_catalog/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sul-dlss/preservation_catalog/labels{/name}","releases_url":"https://api.github.com/repos/sul-dlss/preservation_catalog/releases{/id}","deployments_url":"https://api.github.com/repos/sul-dlss/preservation_catalog/deployments","created_at":"2017-08-16T17:55:52Z","updated_at":"2018-06-22T01:19:45Z","pushed_at":"2018-06-22T02:57:08Z","git_url":"git://github.com/sul-dlss/preservation_catalog.git","ssh_url":"git@github.com:sul-dlss/preservation_catalog.git","clone_url":"https://github.com/sul-dlss/preservation_catalog.git","svn_url":"https://github.com/sul-dlss/preservation_catalog","homepage":"","size":271766,"stargazers_count":1,"watchers_count":1,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":96,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":1,"open_issues":96,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/sul-dlss/preservation_catalog/pulls/923"},"html":{"href":"https://github.com/sul-dlss/preservation_catalog/pull/923"},"issue":{"href":"https://api.github.com/repos/sul-dlss/preservation_catalog/issues/923"},"comments":{"href":"https://api.github.com/repos/sul-dlss/preservation_catalog/issues/923/comments"},"review_comments":{"href":"https://api.github.com/repos/sul-dlss/preservation_catalog/pulls/923/comments"},"review_comment":{"href":"https://api.github.com/repos/sul-dlss/preservation_catalog/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/sul-dlss/preservation_catalog/pulls/923/commits"},"statuses":{"href":"https://api.github.com/repos/sul-dlss/preservation_catalog/statuses/6857d8c18cefbe0e7366e1321e44325f5a50aeb1"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"ndushay"}}