{"action":"closed","number":17457,"pull_request":{"url":"https://api.github.com/repos/ManageIQ/manageiq/pulls/17457","id":189434837,"node_id":"MDExOlB1bGxSZXF1ZXN0MTg5NDM0ODM3","html_url":"https://github.com/ManageIQ/manageiq/pull/17457","diff_url":"https://github.com/ManageIQ/manageiq/pull/17457.diff","patch_url":"https://github.com/ManageIQ/manageiq/pull/17457.patch","issue_url":"https://api.github.com/repos/ManageIQ/manageiq/issues/17457","number":17457,"state":"closed","locked":false,"title":"Add MiqPreloader.polymorphic_preload_for_child_classes","user":{"login":"NickLaMuro","id":314014,"node_id":"MDQ6VXNlcjMxNDAxNA==","avatar_url":"https://avatars0.githubusercontent.com/u/314014?v=4","gravatar_id":"","url":"https://api.github.com/users/NickLaMuro","html_url":"https://github.com/NickLaMuro","followers_url":"https://api.github.com/users/NickLaMuro/followers","following_url":"https://api.github.com/users/NickLaMuro/following{/other_user}","gists_url":"https://api.github.com/users/NickLaMuro/gists{/gist_id}","starred_url":"https://api.github.com/users/NickLaMuro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NickLaMuro/subscriptions","organizations_url":"https://api.github.com/users/NickLaMuro/orgs","repos_url":"https://api.github.com/users/NickLaMuro/repos","events_url":"https://api.github.com/users/NickLaMuro/events{/privacy}","received_events_url":"https://api.github.com/users/NickLaMuro/received_events","type":"User","site_admin":false},"body":"This branch was extracted from https://github.com/ManageIQ/manageiq/pull/17354 to bring attention to the large addition to `MiqPreloader`, which adds a new method:\r\n\r\n```ruby\r\nMiqPreloader.polymorphic_preload_for_child_classes\r\n```\r\n\r\nThis is a specialized preloader for classes with polymorphic relationships that allows for targeted preloading for those specific class types on said polymorphic relationships.  This allows for taking\r\nadvantage of those associations by allowing scopes to be applied to the specific relationships and subsequent calls to the relationship can have those query definitions applied.\r\n\r\nThis means you can do things like this:\r\n\r\n```ruby\r\nirb> tree = ExtManagementSystem.last.fulltree_rels_arranged(:except_type => \"VmOrTemplate\")\r\n#=> nodes ExtManagementSystem, EmsCluster, EmsFolder, and Host `relationship_type` records\r\nirb> records = Relationship.flatten_arranged_rels(tree)\r\nirb> hosts_scope = Host.select(Host.arel_table[Arel.star], :v_total_vms)\r\nirb> preloaders_per_class = { EmsCluster => [:hosts, hosts_scope], Host => hosts_scope }\r\nirb> MiqPreloader.polymorphic_preload_for_child_classes(records, nil, preloaders_per_class)\r\n#=> Host records with have the `v_total_vms` column load, and hosts accessed through EmsCluster will as well\r\n```\r\n\r\n\r\nLinks\r\n-----\r\n\r\n* Extracted from https://github.com/ManageIQ/manageiq/pull/17354","created_at":"2018-05-21T17:02:04Z","updated_at":"2018-11-26T05:00:42Z","closed_at":"2018-11-26T05:00:42Z","merged_at":null,"merge_commit_sha":"9e8f6ebb235068a442a238cdbabe0542f70a2a34","assignee":{"login":"Fryguy","id":52120,"node_id":"MDQ6VXNlcjUyMTIw","avatar_url":"https://avatars3.githubusercontent.com/u/52120?v=4","gravatar_id":"","url":"https://api.github.com/users/Fryguy","html_url":"https://github.com/Fryguy","followers_url":"https://api.github.com/users/Fryguy/followers","following_url":"https://api.github.com/users/Fryguy/following{/other_user}","gists_url":"https://api.github.com/users/Fryguy/gists{/gist_id}","starred_url":"https://api.github.com/users/Fryguy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Fryguy/subscriptions","organizations_url":"https://api.github.com/users/Fryguy/orgs","repos_url":"https://api.github.com/users/Fryguy/repos","events_url":"https://api.github.com/users/Fryguy/events{/privacy}","received_events_url":"https://api.github.com/users/Fryguy/received_events","type":"User","site_admin":false},"assignees":[{"login":"Fryguy","id":52120,"node_id":"MDQ6VXNlcjUyMTIw","avatar_url":"https://avatars3.githubusercontent.com/u/52120?v=4","gravatar_id":"","url":"https://api.github.com/users/Fryguy","html_url":"https://github.com/Fryguy","followers_url":"https://api.github.com/users/Fryguy/followers","following_url":"https://api.github.com/users/Fryguy/following{/other_user}","gists_url":"https://api.github.com/users/Fryguy/gists{/gist_id}","starred_url":"https://api.github.com/users/Fryguy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Fryguy/subscriptions","organizations_url":"https://api.github.com/users/Fryguy/orgs","repos_url":"https://api.github.com/users/Fryguy/repos","events_url":"https://api.github.com/users/Fryguy/events{/privacy}","received_events_url":"https://api.github.com/users/Fryguy/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":129042774,"node_id":"MDU6TGFiZWwxMjkwNDI3NzQ=","url":"https://api.github.com/repos/ManageIQ/manageiq/labels/performance","name":"performance","color":"e99695","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/ManageIQ/manageiq/pulls/17457/commits","review_comments_url":"https://api.github.com/repos/ManageIQ/manageiq/pulls/17457/comments","review_comment_url":"https://api.github.com/repos/ManageIQ/manageiq/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ManageIQ/manageiq/issues/17457/comments","statuses_url":"https://api.github.com/repos/ManageIQ/manageiq/statuses/2f971d51ee5dbb4ca2e5b4924db9cc11dc5886f3","head":{"label":"NickLaMuro:miq_preloader_polymorphic_improvements","ref":"miq_preloader_polymorphic_improvements","sha":"2f971d51ee5dbb4ca2e5b4924db9cc11dc5886f3","user":{"login":"NickLaMuro","id":314014,"node_id":"MDQ6VXNlcjMxNDAxNA==","avatar_url":"https://avatars0.githubusercontent.com/u/314014?v=4","gravatar_id":"","url":"https://api.github.com/users/NickLaMuro","html_url":"https://github.com/NickLaMuro","followers_url":"https://api.github.com/users/NickLaMuro/followers","following_url":"https://api.github.com/users/NickLaMuro/following{/other_user}","gists_url":"https://api.github.com/users/NickLaMuro/gists{/gist_id}","starred_url":"https://api.github.com/users/NickLaMuro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NickLaMuro/subscriptions","organizations_url":"https://api.github.com/users/NickLaMuro/orgs","repos_url":"https://api.github.com/users/NickLaMuro/repos","events_url":"https://api.github.com/users/NickLaMuro/events{/privacy}","received_events_url":"https://api.github.com/users/NickLaMuro/received_events","type":"User","site_admin":false},"repo":{"id":60729101,"node_id":"MDEwOlJlcG9zaXRvcnk2MDcyOTEwMQ==","name":"manageiq","full_name":"NickLaMuro/manageiq","private":false,"owner":{"login":"NickLaMuro","id":314014,"node_id":"MDQ6VXNlcjMxNDAxNA==","avatar_url":"https://avatars0.githubusercontent.com/u/314014?v=4","gravatar_id":"","url":"https://api.github.com/users/NickLaMuro","html_url":"https://github.com/NickLaMuro","followers_url":"https://api.github.com/users/NickLaMuro/followers","following_url":"https://api.github.com/users/NickLaMuro/following{/other_user}","gists_url":"https://api.github.com/users/NickLaMuro/gists{/gist_id}","starred_url":"https://api.github.com/users/NickLaMuro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NickLaMuro/subscriptions","organizations_url":"https://api.github.com/users/NickLaMuro/orgs","repos_url":"https://api.github.com/users/NickLaMuro/repos","events_url":"https://api.github.com/users/NickLaMuro/events{/privacy}","received_events_url":"https://api.github.com/users/NickLaMuro/received_events","type":"User","site_admin":false},"html_url":"https://github.com/NickLaMuro/manageiq","description":"ManageIQ Cloud Management Platform","fork":true,"url":"https://api.github.com/repos/NickLaMuro/manageiq","forks_url":"https://api.github.com/repos/NickLaMuro/manageiq/forks","keys_url":"https://api.github.com/repos/NickLaMuro/manageiq/keys{/key_id}","collaborators_url":"https://api.github.com/repos/NickLaMuro/manageiq/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/NickLaMuro/manageiq/teams","hooks_url":"https://api.github.com/repos/NickLaMuro/manageiq/hooks","issue_events_url":"https://api.github.com/repos/NickLaMuro/manageiq/issues/events{/number}","events_url":"https://api.github.com/repos/NickLaMuro/manageiq/events","assignees_url":"https://api.github.com/repos/NickLaMuro/manageiq/assignees{/user}","branches_url":"https://api.github.com/repos/NickLaMuro/manageiq/branches{/branch}","tags_url":"https://api.github.com/repos/NickLaMuro/manageiq/tags","blobs_url":"https://api.github.com/repos/NickLaMuro/manageiq/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/NickLaMuro/manageiq/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/NickLaMuro/manageiq/git/refs{/sha}","trees_url":"https://api.github.com/repos/NickLaMuro/manageiq/git/trees{/sha}","statuses_url":"https://api.github.com/repos/NickLaMuro/manageiq/statuses/{sha}","languages_url":"https://api.github.com/repos/NickLaMuro/manageiq/languages","stargazers_url":"https://api.github.com/repos/NickLaMuro/manageiq/stargazers","contributors_url":"https://api.github.com/repos/NickLaMuro/manageiq/contributors","subscribers_url":"https://api.github.com/repos/NickLaMuro/manageiq/subscribers","subscription_url":"https://api.github.com/repos/NickLaMuro/manageiq/subscription","commits_url":"https://api.github.com/repos/NickLaMuro/manageiq/commits{/sha}","git_commits_url":"https://api.github.com/repos/NickLaMuro/manageiq/git/commits{/sha}","comments_url":"https://api.github.com/repos/NickLaMuro/manageiq/comments{/number}","issue_comment_url":"https://api.github.com/repos/NickLaMuro/manageiq/issues/comments{/number}","contents_url":"https://api.github.com/repos/NickLaMuro/manageiq/contents/{+path}","compare_url":"https://api.github.com/repos/NickLaMuro/manageiq/compare/{base}...{head}","merges_url":"https://api.github.com/repos/NickLaMuro/manageiq/merges","archive_url":"https://api.github.com/repos/NickLaMuro/manageiq/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/NickLaMuro/manageiq/downloads","issues_url":"https://api.github.com/repos/NickLaMuro/manageiq/issues{/number}","pulls_url":"https://api.github.com/repos/NickLaMuro/manageiq/pulls{/number}","milestones_url":"https://api.github.com/repos/NickLaMuro/manageiq/milestones{/number}","notifications_url":"https://api.github.com/repos/NickLaMuro/manageiq/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/NickLaMuro/manageiq/labels{/name}","releases_url":"https://api.github.com/repos/NickLaMuro/manageiq/releases{/id}","deployments_url":"https://api.github.com/repos/NickLaMuro/manageiq/deployments","created_at":"2016-06-08T20:36:58Z","updated_at":"2018-11-20T23:32:15Z","pushed_at":"2018-11-20T23:32:13Z","git_url":"git://github.com/NickLaMuro/manageiq.git","ssh_url":"git@github.com:NickLaMuro/manageiq.git","clone_url":"https://github.com/NickLaMuro/manageiq.git","svn_url":"https://github.com/NickLaMuro/manageiq","homepage":"manageiq.org","size":253708,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"ManageIQ:master","ref":"master","sha":"6f61221fd8be94a9c68c985404dd94230645c59b","user":{"login":"ManageIQ","id":1125575,"node_id":"MDEyOk9yZ2FuaXphdGlvbjExMjU1NzU=","avatar_url":"https://avatars0.githubusercontent.com/u/1125575?v=4","gravatar_id":"","url":"https://api.github.com/users/ManageIQ","html_url":"https://github.com/ManageIQ","followers_url":"https://api.github.com/users/ManageIQ/followers","following_url":"https://api.github.com/users/ManageIQ/following{/other_user}","gists_url":"https://api.github.com/users/ManageIQ/gists{/gist_id}","starred_url":"https://api.github.com/users/ManageIQ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ManageIQ/subscriptions","organizations_url":"https://api.github.com/users/ManageIQ/orgs","repos_url":"https://api.github.com/users/ManageIQ/repos","events_url":"https://api.github.com/users/ManageIQ/events{/privacy}","received_events_url":"https://api.github.com/users/ManageIQ/received_events","type":"Organization","site_admin":false},"repo":{"id":20789757,"node_id":"MDEwOlJlcG9zaXRvcnkyMDc4OTc1Nw==","name":"manageiq","full_name":"ManageIQ/manageiq","private":false,"owner":{"login":"ManageIQ","id":1125575,"node_id":"MDEyOk9yZ2FuaXphdGlvbjExMjU1NzU=","avatar_url":"https://avatars0.githubusercontent.com/u/1125575?v=4","gravatar_id":"","url":"https://api.github.com/users/ManageIQ","html_url":"https://github.com/ManageIQ","followers_url":"https://api.github.com/users/ManageIQ/followers","following_url":"https://api.github.com/users/ManageIQ/following{/other_user}","gists_url":"https://api.github.com/users/ManageIQ/gists{/gist_id}","starred_url":"https://api.github.com/users/ManageIQ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ManageIQ/subscriptions","organizations_url":"https://api.github.com/users/ManageIQ/orgs","repos_url":"https://api.github.com/users/ManageIQ/repos","events_url":"https://api.github.com/users/ManageIQ/events{/privacy}","received_events_url":"https://api.github.com/users/ManageIQ/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/ManageIQ/manageiq","description":"ManageIQ Open-Source Management Platform","fork":false,"url":"https://api.github.com/repos/ManageIQ/manageiq","forks_url":"https://api.github.com/repos/ManageIQ/manageiq/forks","keys_url":"https://api.github.com/repos/ManageIQ/manageiq/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ManageIQ/manageiq/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ManageIQ/manageiq/teams","hooks_url":"https://api.github.com/repos/ManageIQ/manageiq/hooks","issue_events_url":"https://api.github.com/repos/ManageIQ/manageiq/issues/events{/number}","events_url":"https://api.github.com/repos/ManageIQ/manageiq/events","assignees_url":"https://api.github.com/repos/ManageIQ/manageiq/assignees{/user}","branches_url":"https://api.github.com/repos/ManageIQ/manageiq/branches{/branch}","tags_url":"https://api.github.com/repos/ManageIQ/manageiq/tags","blobs_url":"https://api.github.com/repos/ManageIQ/manageiq/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ManageIQ/manageiq/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ManageIQ/manageiq/git/refs{/sha}","trees_url":"https://api.github.com/repos/ManageIQ/manageiq/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ManageIQ/manageiq/statuses/{sha}","languages_url":"https://api.github.com/repos/ManageIQ/manageiq/languages","stargazers_url":"https://api.github.com/repos/ManageIQ/manageiq/stargazers","contributors_url":"https://api.github.com/repos/ManageIQ/manageiq/contributors","subscribers_url":"https://api.github.com/repos/ManageIQ/manageiq/subscribers","subscription_url":"https://api.github.com/repos/ManageIQ/manageiq/subscription","commits_url":"https://api.github.com/repos/ManageIQ/manageiq/commits{/sha}","git_commits_url":"https://api.github.com/repos/ManageIQ/manageiq/git/commits{/sha}","comments_url":"https://api.github.com/repos/ManageIQ/manageiq/comments{/number}","issue_comment_url":"https://api.github.com/repos/ManageIQ/manageiq/issues/comments{/number}","contents_url":"https://api.github.com/repos/ManageIQ/manageiq/contents/{+path}","compare_url":"https://api.github.com/repos/ManageIQ/manageiq/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ManageIQ/manageiq/merges","archive_url":"https://api.github.com/repos/ManageIQ/manageiq/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ManageIQ/manageiq/downloads","issues_url":"https://api.github.com/repos/ManageIQ/manageiq/issues{/number}","pulls_url":"https://api.github.com/repos/ManageIQ/manageiq/pulls{/number}","milestones_url":"https://api.github.com/repos/ManageIQ/manageiq/milestones{/number}","notifications_url":"https://api.github.com/repos/ManageIQ/manageiq/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ManageIQ/manageiq/labels{/name}","releases_url":"https://api.github.com/repos/ManageIQ/manageiq/releases{/id}","deployments_url":"https://api.github.com/repos/ManageIQ/manageiq/deployments","created_at":"2014-06-13T02:31:26Z","updated_at":"2018-11-24T15:38:21Z","pushed_at":"2018-11-23T10:51:25Z","git_url":"git://github.com/ManageIQ/manageiq.git","ssh_url":"git@github.com:ManageIQ/manageiq.git","clone_url":"https://github.com/ManageIQ/manageiq.git","svn_url":"https://github.com/ManageIQ/manageiq","homepage":"manageiq.org","size":259136,"stargazers_count":752,"watchers_count":752,"language":"Ruby","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":669,"mirror_url":null,"archived":false,"open_issues_count":554,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":669,"open_issues":554,"watchers":752,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ManageIQ/manageiq/pulls/17457"},"html":{"href":"https://github.com/ManageIQ/manageiq/pull/17457"},"issue":{"href":"https://api.github.com/repos/ManageIQ/manageiq/issues/17457"},"comments":{"href":"https://api.github.com/repos/ManageIQ/manageiq/issues/17457/comments"},"review_comments":{"href":"https://api.github.com/repos/ManageIQ/manageiq/pulls/17457/comments"},"review_comment":{"href":"https://api.github.com/repos/ManageIQ/manageiq/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ManageIQ/manageiq/pulls/17457/commits"},"statuses":{"href":"https://api.github.com/repos/ManageIQ/manageiq/statuses/2f971d51ee5dbb4ca2e5b4924db9cc11dc5886f3"}},"author_association":"MEMBER","merged":false,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":null,"comments":3,"review_comments":0,"maintainer_can_modify":false,"commits":1,"additions":143,"deletions":0,"changed_files":2}}
{"actor":{"display_login":"miq-bot"}}