{"action":"created","comment":{"url":"https://api.github.com/repos/Katello/katello/pulls/comments/37796895","id":37796895,"diff_hunk":"@@ -240,12 +240,22 @@ def check_ready_to_promote!\n     end\n \n     def check_ready_to_destroy!\n+      check_used_by_composite!\n+\n       if environments.any? && !organization.being_deleted?\n         fail _(\"Cannot delete version while it is in environments: %s\") % environments.map(&:name).join(\",\")\n       end\n       return true\n     end\n \n+    def check_used_by_composite!\n+      if composite_content_views.any? && !organization.being_deleted?\n+        fail _(\"Cannot delete version while it is in use by composite content views: %s\") %","path":"app/models/katello/content_view_version.rb","position":14,"original_position":14,"commit_id":"1382f64f8caa7063ce9642ed0c71a179cf620b9f","original_commit_id":"1382f64f8caa7063ce9642ed0c71a179cf620b9f","user":{"login":"bbuckingham","id":1319246,"avatar_url":"https://avatars.githubusercontent.com/u/1319246?v=3","gravatar_id":"","url":"https://api.github.com/users/bbuckingham","html_url":"https://github.com/bbuckingham","followers_url":"https://api.github.com/users/bbuckingham/followers","following_url":"https://api.github.com/users/bbuckingham/following{/other_user}","gists_url":"https://api.github.com/users/bbuckingham/gists{/gist_id}","starred_url":"https://api.github.com/users/bbuckingham/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bbuckingham/subscriptions","organizations_url":"https://api.github.com/users/bbuckingham/orgs","repos_url":"https://api.github.com/users/bbuckingham/repos","events_url":"https://api.github.com/users/bbuckingham/events{/privacy}","received_events_url":"https://api.github.com/users/bbuckingham/received_events","type":"User","site_admin":false},"body":"Do you have a suggestion on alternative name?","created_at":"2015-08-24T19:58:06Z","updated_at":"2015-08-24T19:58:06Z","html_url":"https://github.com/Katello/katello/pull/5439#discussion_r37796895","pull_request_url":"https://api.github.com/repos/Katello/katello/pulls/5439","_links":{"self":{"href":"https://api.github.com/repos/Katello/katello/pulls/comments/37796895"},"html":{"href":"https://github.com/Katello/katello/pull/5439#discussion_r37796895"},"pull_request":{"href":"https://api.github.com/repos/Katello/katello/pulls/5439"}}},"pull_request":{"url":"https://api.github.com/repos/Katello/katello/pulls/5439","id":43211138,"html_url":"https://github.com/Katello/katello/pull/5439","diff_url":"https://github.com/Katello/katello/pull/5439.diff","patch_url":"https://github.com/Katello/katello/pull/5439.patch","issue_url":"https://api.github.com/repos/Katello/katello/issues/5439","number":5439,"state":"open","locked":false,"title":"fixes #11472 - Do not allow deletion of a content view version that is part of a composite view","user":{"login":"bbuckingham","id":1319246,"avatar_url":"https://avatars.githubusercontent.com/u/1319246?v=3","gravatar_id":"","url":"https://api.github.com/users/bbuckingham","html_url":"https://github.com/bbuckingham","followers_url":"https://api.github.com/users/bbuckingham/followers","following_url":"https://api.github.com/users/bbuckingham/following{/other_user}","gists_url":"https://api.github.com/users/bbuckingham/gists{/gist_id}","starred_url":"https://api.github.com/users/bbuckingham/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bbuckingham/subscriptions","organizations_url":"https://api.github.com/users/bbuckingham/orgs","repos_url":"https://api.github.com/users/bbuckingham/repos","events_url":"https://api.github.com/users/bbuckingham/events{/privacy}","received_events_url":"https://api.github.com/users/bbuckingham/received_events","type":"User","site_admin":false},"body":"Note: this commit also moves a few tests in the content_view_version_test that\r\nwere not getting executed due to their placement in the test file.","created_at":"2015-08-24T19:20:22Z","updated_at":"2015-08-24T19:58:06Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8bfc118bd7c4e972b4061cfb6c3cee35bca269a1","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Katello/katello/pulls/5439/commits","review_comments_url":"https://api.github.com/repos/Katello/katello/pulls/5439/comments","review_comment_url":"https://api.github.com/repos/Katello/katello/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Katello/katello/issues/5439/comments","statuses_url":"https://api.github.com/repos/Katello/katello/statuses/1382f64f8caa7063ce9642ed0c71a179cf620b9f","head":{"label":"bbuckingham:issue-11472","ref":"issue-11472","sha":"1382f64f8caa7063ce9642ed0c71a179cf620b9f","user":{"login":"bbuckingham","id":1319246,"avatar_url":"https://avatars.githubusercontent.com/u/1319246?v=3","gravatar_id":"","url":"https://api.github.com/users/bbuckingham","html_url":"https://github.com/bbuckingham","followers_url":"https://api.github.com/users/bbuckingham/followers","following_url":"https://api.github.com/users/bbuckingham/following{/other_user}","gists_url":"https://api.github.com/users/bbuckingham/gists{/gist_id}","starred_url":"https://api.github.com/users/bbuckingham/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bbuckingham/subscriptions","organizations_url":"https://api.github.com/users/bbuckingham/orgs","repos_url":"https://api.github.com/users/bbuckingham/repos","events_url":"https://api.github.com/users/bbuckingham/events{/privacy}","received_events_url":"https://api.github.com/users/bbuckingham/received_events","type":"User","site_admin":false},"repo":{"id":4041448,"name":"katello","full_name":"bbuckingham/katello","owner":{"login":"bbuckingham","id":1319246,"avatar_url":"https://avatars.githubusercontent.com/u/1319246?v=3","gravatar_id":"","url":"https://api.github.com/users/bbuckingham","html_url":"https://github.com/bbuckingham","followers_url":"https://api.github.com/users/bbuckingham/followers","following_url":"https://api.github.com/users/bbuckingham/following{/other_user}","gists_url":"https://api.github.com/users/bbuckingham/gists{/gist_id}","starred_url":"https://api.github.com/users/bbuckingham/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bbuckingham/subscriptions","organizations_url":"https://api.github.com/users/bbuckingham/orgs","repos_url":"https://api.github.com/users/bbuckingham/repos","events_url":"https://api.github.com/users/bbuckingham/events{/privacy}","received_events_url":"https://api.github.com/users/bbuckingham/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/bbuckingham/katello","description":"Katello integrates open source systems management tools into a single solution for controlling the lifecycle of your machines.","fork":true,"url":"https://api.github.com/repos/bbuckingham/katello","forks_url":"https://api.github.com/repos/bbuckingham/katello/forks","keys_url":"https://api.github.com/repos/bbuckingham/katello/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bbuckingham/katello/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bbuckingham/katello/teams","hooks_url":"https://api.github.com/repos/bbuckingham/katello/hooks","issue_events_url":"https://api.github.com/repos/bbuckingham/katello/issues/events{/number}","events_url":"https://api.github.com/repos/bbuckingham/katello/events","assignees_url":"https://api.github.com/repos/bbuckingham/katello/assignees{/user}","branches_url":"https://api.github.com/repos/bbuckingham/katello/branches{/branch}","tags_url":"https://api.github.com/repos/bbuckingham/katello/tags","blobs_url":"https://api.github.com/repos/bbuckingham/katello/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bbuckingham/katello/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bbuckingham/katello/git/refs{/sha}","trees_url":"https://api.github.com/repos/bbuckingham/katello/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bbuckingham/katello/statuses/{sha}","languages_url":"https://api.github.com/repos/bbuckingham/katello/languages","stargazers_url":"https://api.github.com/repos/bbuckingham/katello/stargazers","contributors_url":"https://api.github.com/repos/bbuckingham/katello/contributors","subscribers_url":"https://api.github.com/repos/bbuckingham/katello/subscribers","subscription_url":"https://api.github.com/repos/bbuckingham/katello/subscription","commits_url":"https://api.github.com/repos/bbuckingham/katello/commits{/sha}","git_commits_url":"https://api.github.com/repos/bbuckingham/katello/git/commits{/sha}","comments_url":"https://api.github.com/repos/bbuckingham/katello/comments{/number}","issue_comment_url":"https://api.github.com/repos/bbuckingham/katello/issues/comments{/number}","contents_url":"https://api.github.com/repos/bbuckingham/katello/contents/{+path}","compare_url":"https://api.github.com/repos/bbuckingham/katello/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bbuckingham/katello/merges","archive_url":"https://api.github.com/repos/bbuckingham/katello/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bbuckingham/katello/downloads","issues_url":"https://api.github.com/repos/bbuckingham/katello/issues{/number}","pulls_url":"https://api.github.com/repos/bbuckingham/katello/pulls{/number}","milestones_url":"https://api.github.com/repos/bbuckingham/katello/milestones{/number}","notifications_url":"https://api.github.com/repos/bbuckingham/katello/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bbuckingham/katello/labels{/name}","releases_url":"https://api.github.com/repos/bbuckingham/katello/releases{/id}","created_at":"2012-04-16T14:14:54Z","updated_at":"2014-08-14T18:26:07Z","pushed_at":"2015-08-24T19:19:22Z","git_url":"git://github.com/bbuckingham/katello.git","ssh_url":"git@github.com:bbuckingham/katello.git","clone_url":"https://github.com/bbuckingham/katello.git","svn_url":"https://github.com/bbuckingham/katello","homepage":"katello.org","size":72412,"stargazers_count":2,"watchers_count":2,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":2,"default_branch":"master"}},"base":{"label":"Katello:master","ref":"master","sha":"ac87cabf440ea423f7dc59991965d8155face2ad","user":{"login":"Katello","id":1316386,"avatar_url":"https://avatars.githubusercontent.com/u/1316386?v=3","gravatar_id":"","url":"https://api.github.com/users/Katello","html_url":"https://github.com/Katello","followers_url":"https://api.github.com/users/Katello/followers","following_url":"https://api.github.com/users/Katello/following{/other_user}","gists_url":"https://api.github.com/users/Katello/gists{/gist_id}","starred_url":"https://api.github.com/users/Katello/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Katello/subscriptions","organizations_url":"https://api.github.com/users/Katello/orgs","repos_url":"https://api.github.com/users/Katello/repos","events_url":"https://api.github.com/users/Katello/events{/privacy}","received_events_url":"https://api.github.com/users/Katello/received_events","type":"Organization","site_admin":false},"repo":{"id":4007018,"name":"katello","full_name":"Katello/katello","owner":{"login":"Katello","id":1316386,"avatar_url":"https://avatars.githubusercontent.com/u/1316386?v=3","gravatar_id":"","url":"https://api.github.com/users/Katello","html_url":"https://github.com/Katello","followers_url":"https://api.github.com/users/Katello/followers","following_url":"https://api.github.com/users/Katello/following{/other_user}","gists_url":"https://api.github.com/users/Katello/gists{/gist_id}","starred_url":"https://api.github.com/users/Katello/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Katello/subscriptions","organizations_url":"https://api.github.com/users/Katello/orgs","repos_url":"https://api.github.com/users/Katello/repos","events_url":"https://api.github.com/users/Katello/events{/privacy}","received_events_url":"https://api.github.com/users/Katello/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Katello/katello","description":"Katello integrates open source systems management tools into a single solution for controlling the lifecycle of your machines.","fork":false,"url":"https://api.github.com/repos/Katello/katello","forks_url":"https://api.github.com/repos/Katello/katello/forks","keys_url":"https://api.github.com/repos/Katello/katello/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Katello/katello/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Katello/katello/teams","hooks_url":"https://api.github.com/repos/Katello/katello/hooks","issue_events_url":"https://api.github.com/repos/Katello/katello/issues/events{/number}","events_url":"https://api.github.com/repos/Katello/katello/events","assignees_url":"https://api.github.com/repos/Katello/katello/assignees{/user}","branches_url":"https://api.github.com/repos/Katello/katello/branches{/branch}","tags_url":"https://api.github.com/repos/Katello/katello/tags","blobs_url":"https://api.github.com/repos/Katello/katello/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Katello/katello/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Katello/katello/git/refs{/sha}","trees_url":"https://api.github.com/repos/Katello/katello/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Katello/katello/statuses/{sha}","languages_url":"https://api.github.com/repos/Katello/katello/languages","stargazers_url":"https://api.github.com/repos/Katello/katello/stargazers","contributors_url":"https://api.github.com/repos/Katello/katello/contributors","subscribers_url":"https://api.github.com/repos/Katello/katello/subscribers","subscription_url":"https://api.github.com/repos/Katello/katello/subscription","commits_url":"https://api.github.com/repos/Katello/katello/commits{/sha}","git_commits_url":"https://api.github.com/repos/Katello/katello/git/commits{/sha}","comments_url":"https://api.github.com/repos/Katello/katello/comments{/number}","issue_comment_url":"https://api.github.com/repos/Katello/katello/issues/comments{/number}","contents_url":"https://api.github.com/repos/Katello/katello/contents/{+path}","compare_url":"https://api.github.com/repos/Katello/katello/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Katello/katello/merges","archive_url":"https://api.github.com/repos/Katello/katello/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Katello/katello/downloads","issues_url":"https://api.github.com/repos/Katello/katello/issues{/number}","pulls_url":"https://api.github.com/repos/Katello/katello/pulls{/number}","milestones_url":"https://api.github.com/repos/Katello/katello/milestones{/number}","notifications_url":"https://api.github.com/repos/Katello/katello/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Katello/katello/labels{/name}","releases_url":"https://api.github.com/repos/Katello/katello/releases{/id}","created_at":"2012-04-12T16:59:08Z","updated_at":"2015-08-13T18:20:46Z","pushed_at":"2015-08-24T19:30:39Z","git_url":"git://github.com/Katello/katello.git","ssh_url":"git@github.com:Katello/katello.git","clone_url":"https://github.com/Katello/katello.git","svn_url":"https://github.com/Katello/katello","homepage":"katello.org","size":237023,"stargazers_count":168,"watchers_count":168,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":113,"mirror_url":null,"open_issues_count":97,"forks":113,"open_issues":97,"watchers":168,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Katello/katello/pulls/5439"},"html":{"href":"https://github.com/Katello/katello/pull/5439"},"issue":{"href":"https://api.github.com/repos/Katello/katello/issues/5439"},"comments":{"href":"https://api.github.com/repos/Katello/katello/issues/5439/comments"},"review_comments":{"href":"https://api.github.com/repos/Katello/katello/pulls/5439/comments"},"review_comment":{"href":"https://api.github.com/repos/Katello/katello/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Katello/katello/pulls/5439/commits"},"statuses":{"href":"https://api.github.com/repos/Katello/katello/statuses/1382f64f8caa7063ce9642ed0c71a179cf620b9f"}}}}