{"action":"created","issue":{"url":"https://api.github.com/repos/ManageIQ/manageiq/issues/2140","labels_url":"https://api.github.com/repos/ManageIQ/manageiq/issues/2140/labels{/name}","comments_url":"https://api.github.com/repos/ManageIQ/manageiq/issues/2140/comments","events_url":"https://api.github.com/repos/ManageIQ/manageiq/issues/2140/events","html_url":"https://github.com/ManageIQ/manageiq/pull/2140","id":60925903,"number":2140,"title":"eagerly load `deletes` collection proxy","user":{"login":"tenderlove","id":3124,"avatar_url":"https://avatars.githubusercontent.com/u/3124?v=3","gravatar_id":"","url":"https://api.github.com/users/tenderlove","html_url":"https://github.com/tenderlove","followers_url":"https://api.github.com/users/tenderlove/followers","following_url":"https://api.github.com/users/tenderlove/following{/other_user}","gists_url":"https://api.github.com/users/tenderlove/gists{/gist_id}","starred_url":"https://api.github.com/users/tenderlove/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tenderlove/subscriptions","organizations_url":"https://api.github.com/users/tenderlove/orgs","repos_url":"https://api.github.com/users/tenderlove/repos","events_url":"https://api.github.com/users/tenderlove/events{/privacy}","received_events_url":"https://api.github.com/users/tenderlove/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/ManageIQ/manageiq/labels/rails%204","name":"rails 4","color":"f7c6c7"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-03-12T22:46:22Z","updated_at":"2015-03-13T14:25:06Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/ManageIQ/manageiq/pulls/2140","html_url":"https://github.com/ManageIQ/manageiq/pull/2140","diff_url":"https://github.com/ManageIQ/manageiq/pull/2140.diff","patch_url":"https://github.com/ManageIQ/manageiq/pull/2140.patch"},"body":"`deletes` seems to typically be a collection proxy.  The methods that\r\nsave_inventory_multi call may impact the results of that query, so we\r\nshould eagerly load the collection.\r\n\r\nThis fixes:\r\n\r\n  spec/models/ems_refresh/refreshers/ec2_refresher_other_region_spec.rb"},"comment":{"url":"https://api.github.com/repos/ManageIQ/manageiq/issues/comments/78994139","html_url":"https://github.com/ManageIQ/manageiq/pull/2140#issuecomment-78994139","issue_url":"https://api.github.com/repos/ManageIQ/manageiq/issues/2140","id":78994139,"user":{"login":"Fryguy","id":52120,"avatar_url":"https://avatars.githubusercontent.com/u/52120?v=3","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},"created_at":"2015-03-13T14:25:06Z","updated_at":"2015-03-13T14:25:06Z","body":"@tenderlove Cool.  BTW, most of the callers that get the deletion set, do `deletes = blah.records.dup`.  My question is, what does .dup do on a collection proxy?  In Rails 3.2 it's done so we can manipulate the set of deletes instead of hitting the DB (which is what you are trying to fix here too)."}}