{"action":"created","comment":{"url":"https://api.github.com/repos/theforeman/foreman_discovery/pulls/comments/214009713","pull_request_review_id":150967737,"id":214009713,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxNDAwOTcxMw==","diff_hunk":"@@ -36,6 +36,15 @@ class DiscoveryRule < ApplicationRecord\n     end\n   }\n \n+  def unique_priority\n+    Taxonomy.enabled_taxonomies.each do |enabled_taxonomy|\n+      discovery_rule_ids  =  TaxableTaxonomy.where(taxable_type: 'DiscoveryRule', taxonomy_id: send(\"#{enabled_taxonomy.singularize}_ids\")).pluck(:taxable_id)\n+      if DiscoveryRule.unscoped.find(discovery_rule_ids).pluck(:priority).include?(priority)","path":"app/models/discovery_rule.rb","position":18,"original_position":18,"commit_id":"599776799701b0737b315d3d952e2a7118540847","original_commit_id":"599776799701b0737b315d3d952e2a7118540847","user":{"login":"lzap","id":49752,"node_id":"MDQ6VXNlcjQ5NzUy","avatar_url":"https://avatars0.githubusercontent.com/u/49752?v=4","gravatar_id":"","url":"https://api.github.com/users/lzap","html_url":"https://github.com/lzap","followers_url":"https://api.github.com/users/lzap/followers","following_url":"https://api.github.com/users/lzap/following{/other_user}","gists_url":"https://api.github.com/users/lzap/gists{/gist_id}","starred_url":"https://api.github.com/users/lzap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lzap/subscriptions","organizations_url":"https://api.github.com/users/lzap/orgs","repos_url":"https://api.github.com/users/lzap/repos","events_url":"https://api.github.com/users/lzap/events{/privacy}","received_events_url":"https://api.github.com/users/lzap/received_events","type":"User","site_admin":false},"body":"Wait, taxonomy is somehow being incorporated the line above, then you want to use `unscoped`.","created_at":"2018-08-30T12:26:06Z","updated_at":"2018-08-30T12:26:07Z","html_url":"https://github.com/theforeman/foreman_discovery/pull/450#discussion_r214009713","pull_request_url":"https://api.github.com/repos/theforeman/foreman_discovery/pulls/450","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/theforeman/foreman_discovery/pulls/comments/214009713"},"html":{"href":"https://github.com/theforeman/foreman_discovery/pull/450#discussion_r214009713"},"pull_request":{"href":"https://api.github.com/repos/theforeman/foreman_discovery/pulls/450"}},"in_reply_to_id":213961315},"pull_request":{"url":"https://api.github.com/repos/theforeman/foreman_discovery/pulls/450","id":203813648,"node_id":"MDExOlB1bGxSZXF1ZXN0MjAzODEzNjQ4","html_url":"https://github.com/theforeman/foreman_discovery/pull/450","diff_url":"https://github.com/theforeman/foreman_discovery/pull/450.diff","patch_url":"https://github.com/theforeman/foreman_discovery/pull/450.patch","issue_url":"https://api.github.com/repos/theforeman/foreman_discovery/issues/450","number":450,"state":"open","locked":false,"title":"Fixes #24236 - Distinguish between organizations while assigning prio…","user":{"login":"rahulbajaj0509","id":10976840,"node_id":"MDQ6VXNlcjEwOTc2ODQw","avatar_url":"https://avatars2.githubusercontent.com/u/10976840?v=4","gravatar_id":"","url":"https://api.github.com/users/rahulbajaj0509","html_url":"https://github.com/rahulbajaj0509","followers_url":"https://api.github.com/users/rahulbajaj0509/followers","following_url":"https://api.github.com/users/rahulbajaj0509/following{/other_user}","gists_url":"https://api.github.com/users/rahulbajaj0509/gists{/gist_id}","starred_url":"https://api.github.com/users/rahulbajaj0509/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rahulbajaj0509/subscriptions","organizations_url":"https://api.github.com/users/rahulbajaj0509/orgs","repos_url":"https://api.github.com/users/rahulbajaj0509/repos","events_url":"https://api.github.com/users/rahulbajaj0509/events{/privacy}","received_events_url":"https://api.github.com/users/rahulbajaj0509/received_events","type":"User","site_admin":false},"body":"This patch makes sure there is no conflict between priorities while in different organizations.","created_at":"2018-07-25T11:59:52Z","updated_at":"2018-08-30T12:26:07Z","closed_at":null,"merged_at":null,"merge_commit_sha":"32b32994038a18138f46001ff13803ba5e47ed4b","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":183103726,"node_id":"MDU6TGFiZWwxODMxMDM3MjY=","url":"https://api.github.com/repos/theforeman/foreman_discovery/labels/Needs%20re-review","name":"Needs re-review","color":"ededed","default":false},{"id":137452807,"node_id":"MDU6TGFiZWwxMzc0NTI4MDc=","url":"https://api.github.com/repos/theforeman/foreman_discovery/labels/Needs%20testing","name":"Needs testing","color":"207de5","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/theforeman/foreman_discovery/pulls/450/commits","review_comments_url":"https://api.github.com/repos/theforeman/foreman_discovery/pulls/450/comments","review_comment_url":"https://api.github.com/repos/theforeman/foreman_discovery/pulls/comments{/number}","comments_url":"https://api.github.com/repos/theforeman/foreman_discovery/issues/450/comments","statuses_url":"https://api.github.com/repos/theforeman/foreman_discovery/statuses/599776799701b0737b315d3d952e2a7118540847","head":{"label":"rahulbajaj0509:priority-uniqueness","ref":"priority-uniqueness","sha":"599776799701b0737b315d3d952e2a7118540847","user":{"login":"rahulbajaj0509","id":10976840,"node_id":"MDQ6VXNlcjEwOTc2ODQw","avatar_url":"https://avatars2.githubusercontent.com/u/10976840?v=4","gravatar_id":"","url":"https://api.github.com/users/rahulbajaj0509","html_url":"https://github.com/rahulbajaj0509","followers_url":"https://api.github.com/users/rahulbajaj0509/followers","following_url":"https://api.github.com/users/rahulbajaj0509/following{/other_user}","gists_url":"https://api.github.com/users/rahulbajaj0509/gists{/gist_id}","starred_url":"https://api.github.com/users/rahulbajaj0509/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rahulbajaj0509/subscriptions","organizations_url":"https://api.github.com/users/rahulbajaj0509/orgs","repos_url":"https://api.github.com/users/rahulbajaj0509/repos","events_url":"https://api.github.com/users/rahulbajaj0509/events{/privacy}","received_events_url":"https://api.github.com/users/rahulbajaj0509/received_events","type":"User","site_admin":false},"repo":{"id":95639871,"node_id":"MDEwOlJlcG9zaXRvcnk5NTYzOTg3MQ==","name":"foreman_discovery","full_name":"rahulbajaj0509/foreman_discovery","owner":{"login":"rahulbajaj0509","id":10976840,"node_id":"MDQ6VXNlcjEwOTc2ODQw","avatar_url":"https://avatars2.githubusercontent.com/u/10976840?v=4","gravatar_id":"","url":"https://api.github.com/users/rahulbajaj0509","html_url":"https://github.com/rahulbajaj0509","followers_url":"https://api.github.com/users/rahulbajaj0509/followers","following_url":"https://api.github.com/users/rahulbajaj0509/following{/other_user}","gists_url":"https://api.github.com/users/rahulbajaj0509/gists{/gist_id}","starred_url":"https://api.github.com/users/rahulbajaj0509/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rahulbajaj0509/subscriptions","organizations_url":"https://api.github.com/users/rahulbajaj0509/orgs","repos_url":"https://api.github.com/users/rahulbajaj0509/repos","events_url":"https://api.github.com/users/rahulbajaj0509/events{/privacy}","received_events_url":"https://api.github.com/users/rahulbajaj0509/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/rahulbajaj0509/foreman_discovery","description":"A plugin to enable Metal-as-a-Service discovery functionality in foreman","fork":true,"url":"https://api.github.com/repos/rahulbajaj0509/foreman_discovery","forks_url":"https://api.github.com/repos/rahulbajaj0509/foreman_discovery/forks","keys_url":"https://api.github.com/repos/rahulbajaj0509/foreman_discovery/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rahulbajaj0509/foreman_discovery/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rahulbajaj0509/foreman_discovery/teams","hooks_url":"https://api.github.com/repos/rahulbajaj0509/foreman_discovery/hooks","issue_events_url":"https://api.github.com/repos/rahulbajaj0509/foreman_discovery/issues/events{/number}","events_url":"https://api.github.com/repos/rahulbajaj0509/foreman_discovery/events","assignees_url":"https://api.github.com/repos/rahulbajaj0509/foreman_discovery/assignees{/user}","branches_url":"https://api.github.com/repos/rahulbajaj0509/foreman_discovery/branches{/branch}","tags_url":"https://api.github.com/repos/rahulbajaj0509/foreman_discovery/tags","blobs_url":"https://api.github.com/repos/rahulbajaj0509/foreman_discovery/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rahulbajaj0509/foreman_discovery/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rahulbajaj0509/foreman_discovery/git/refs{/sha}","trees_url":"https://api.github.com/repos/rahulbajaj0509/foreman_discovery/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rahulbajaj0509/foreman_discovery/statuses/{sha}","languages_url":"https://api.github.com/repos/rahulbajaj0509/foreman_discovery/languages","stargazers_url":"https://api.github.com/repos/rahulbajaj0509/foreman_discovery/stargazers","contributors_url":"https://api.github.com/repos/rahulbajaj0509/foreman_discovery/contributors","subscribers_url":"https://api.github.com/repos/rahulbajaj0509/foreman_discovery/subscribers","subscription_url":"https://api.github.com/repos/rahulbajaj0509/foreman_discovery/subscription","commits_url":"https://api.github.com/repos/rahulbajaj0509/foreman_discovery/commits{/sha}","git_commits_url":"https://api.github.com/repos/rahulbajaj0509/foreman_discovery/git/commits{/sha}","comments_url":"https://api.github.com/repos/rahulbajaj0509/foreman_discovery/comments{/number}","issue_comment_url":"https://api.github.com/repos/rahulbajaj0509/foreman_discovery/issues/comments{/number}","contents_url":"https://api.github.com/repos/rahulbajaj0509/foreman_discovery/contents/{+path}","compare_url":"https://api.github.com/repos/rahulbajaj0509/foreman_discovery/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rahulbajaj0509/foreman_discovery/merges","archive_url":"https://api.github.com/repos/rahulbajaj0509/foreman_discovery/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rahulbajaj0509/foreman_discovery/downloads","issues_url":"https://api.github.com/repos/rahulbajaj0509/foreman_discovery/issues{/number}","pulls_url":"https://api.github.com/repos/rahulbajaj0509/foreman_discovery/pulls{/number}","milestones_url":"https://api.github.com/repos/rahulbajaj0509/foreman_discovery/milestones{/number}","notifications_url":"https://api.github.com/repos/rahulbajaj0509/foreman_discovery/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rahulbajaj0509/foreman_discovery/labels{/name}","releases_url":"https://api.github.com/repos/rahulbajaj0509/foreman_discovery/releases{/id}","deployments_url":"https://api.github.com/repos/rahulbajaj0509/foreman_discovery/deployments","created_at":"2017-06-28T07:08:48Z","updated_at":"2018-07-20T12:06:44Z","pushed_at":"2018-08-30T08:57:29Z","git_url":"git://github.com/rahulbajaj0509/foreman_discovery.git","ssh_url":"git@github.com:rahulbajaj0509/foreman_discovery.git","clone_url":"https://github.com/rahulbajaj0509/foreman_discovery.git","svn_url":"https://github.com/rahulbajaj0509/foreman_discovery","homepage":null,"size":2469,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"gpl-3.0","name":"GNU General Public License v3.0","spdx_id":"GPL-3.0","url":"https://api.github.com/licenses/gpl-3.0","node_id":"MDc6TGljZW5zZTk="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"theforeman:develop","ref":"develop","sha":"3cfb6e5f9a161d25fe5b224d439a27ee932c4888","user":{"login":"theforeman","id":1439844,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE0Mzk4NDQ=","avatar_url":"https://avatars2.githubusercontent.com/u/1439844?v=4","gravatar_id":"","url":"https://api.github.com/users/theforeman","html_url":"https://github.com/theforeman","followers_url":"https://api.github.com/users/theforeman/followers","following_url":"https://api.github.com/users/theforeman/following{/other_user}","gists_url":"https://api.github.com/users/theforeman/gists{/gist_id}","starred_url":"https://api.github.com/users/theforeman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/theforeman/subscriptions","organizations_url":"https://api.github.com/users/theforeman/orgs","repos_url":"https://api.github.com/users/theforeman/repos","events_url":"https://api.github.com/users/theforeman/events{/privacy}","received_events_url":"https://api.github.com/users/theforeman/received_events","type":"Organization","site_admin":false},"repo":{"id":8454019,"node_id":"MDEwOlJlcG9zaXRvcnk4NDU0MDE5","name":"foreman_discovery","full_name":"theforeman/foreman_discovery","owner":{"login":"theforeman","id":1439844,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE0Mzk4NDQ=","avatar_url":"https://avatars2.githubusercontent.com/u/1439844?v=4","gravatar_id":"","url":"https://api.github.com/users/theforeman","html_url":"https://github.com/theforeman","followers_url":"https://api.github.com/users/theforeman/followers","following_url":"https://api.github.com/users/theforeman/following{/other_user}","gists_url":"https://api.github.com/users/theforeman/gists{/gist_id}","starred_url":"https://api.github.com/users/theforeman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/theforeman/subscriptions","organizations_url":"https://api.github.com/users/theforeman/orgs","repos_url":"https://api.github.com/users/theforeman/repos","events_url":"https://api.github.com/users/theforeman/events{/privacy}","received_events_url":"https://api.github.com/users/theforeman/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/theforeman/foreman_discovery","description":"A plugin to enable Metal-as-a-Service discovery functionality in foreman","fork":false,"url":"https://api.github.com/repos/theforeman/foreman_discovery","forks_url":"https://api.github.com/repos/theforeman/foreman_discovery/forks","keys_url":"https://api.github.com/repos/theforeman/foreman_discovery/keys{/key_id}","collaborators_url":"https://api.github.com/repos/theforeman/foreman_discovery/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/theforeman/foreman_discovery/teams","hooks_url":"https://api.github.com/repos/theforeman/foreman_discovery/hooks","issue_events_url":"https://api.github.com/repos/theforeman/foreman_discovery/issues/events{/number}","events_url":"https://api.github.com/repos/theforeman/foreman_discovery/events","assignees_url":"https://api.github.com/repos/theforeman/foreman_discovery/assignees{/user}","branches_url":"https://api.github.com/repos/theforeman/foreman_discovery/branches{/branch}","tags_url":"https://api.github.com/repos/theforeman/foreman_discovery/tags","blobs_url":"https://api.github.com/repos/theforeman/foreman_discovery/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/theforeman/foreman_discovery/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/theforeman/foreman_discovery/git/refs{/sha}","trees_url":"https://api.github.com/repos/theforeman/foreman_discovery/git/trees{/sha}","statuses_url":"https://api.github.com/repos/theforeman/foreman_discovery/statuses/{sha}","languages_url":"https://api.github.com/repos/theforeman/foreman_discovery/languages","stargazers_url":"https://api.github.com/repos/theforeman/foreman_discovery/stargazers","contributors_url":"https://api.github.com/repos/theforeman/foreman_discovery/contributors","subscribers_url":"https://api.github.com/repos/theforeman/foreman_discovery/subscribers","subscription_url":"https://api.github.com/repos/theforeman/foreman_discovery/subscription","commits_url":"https://api.github.com/repos/theforeman/foreman_discovery/commits{/sha}","git_commits_url":"https://api.github.com/repos/theforeman/foreman_discovery/git/commits{/sha}","comments_url":"https://api.github.com/repos/theforeman/foreman_discovery/comments{/number}","issue_comment_url":"https://api.github.com/repos/theforeman/foreman_discovery/issues/comments{/number}","contents_url":"https://api.github.com/repos/theforeman/foreman_discovery/contents/{+path}","compare_url":"https://api.github.com/repos/theforeman/foreman_discovery/compare/{base}...{head}","merges_url":"https://api.github.com/repos/theforeman/foreman_discovery/merges","archive_url":"https://api.github.com/repos/theforeman/foreman_discovery/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/theforeman/foreman_discovery/downloads","issues_url":"https://api.github.com/repos/theforeman/foreman_discovery/issues{/number}","pulls_url":"https://api.github.com/repos/theforeman/foreman_discovery/pulls{/number}","milestones_url":"https://api.github.com/repos/theforeman/foreman_discovery/milestones{/number}","notifications_url":"https://api.github.com/repos/theforeman/foreman_discovery/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/theforeman/foreman_discovery/labels{/name}","releases_url":"https://api.github.com/repos/theforeman/foreman_discovery/releases{/id}","deployments_url":"https://api.github.com/repos/theforeman/foreman_discovery/deployments","created_at":"2013-02-27T10:45:55Z","updated_at":"2018-08-30T11:57:30Z","pushed_at":"2018-08-30T11:57:27Z","git_url":"git://github.com/theforeman/foreman_discovery.git","ssh_url":"git@github.com:theforeman/foreman_discovery.git","clone_url":"https://github.com/theforeman/foreman_discovery.git","svn_url":"https://github.com/theforeman/foreman_discovery","homepage":null,"size":2679,"stargazers_count":45,"watchers_count":45,"language":"Ruby","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":86,"mirror_url":null,"archived":false,"open_issues_count":10,"license":{"key":"gpl-3.0","name":"GNU General Public License v3.0","spdx_id":"GPL-3.0","url":"https://api.github.com/licenses/gpl-3.0","node_id":"MDc6TGljZW5zZTk="},"forks":86,"open_issues":10,"watchers":45,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/theforeman/foreman_discovery/pulls/450"},"html":{"href":"https://github.com/theforeman/foreman_discovery/pull/450"},"issue":{"href":"https://api.github.com/repos/theforeman/foreman_discovery/issues/450"},"comments":{"href":"https://api.github.com/repos/theforeman/foreman_discovery/issues/450/comments"},"review_comments":{"href":"https://api.github.com/repos/theforeman/foreman_discovery/pulls/450/comments"},"review_comment":{"href":"https://api.github.com/repos/theforeman/foreman_discovery/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/theforeman/foreman_discovery/pulls/450/commits"},"statuses":{"href":"https://api.github.com/repos/theforeman/foreman_discovery/statuses/599776799701b0737b315d3d952e2a7118540847"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"lzap"}}