{"action":"created","issue":{"url":"https://api.github.com/repos/ManageIQ/manageiq/issues/2543","labels_url":"https://api.github.com/repos/ManageIQ/manageiq/issues/2543/labels{/name}","comments_url":"https://api.github.com/repos/ManageIQ/manageiq/issues/2543/comments","events_url":"https://api.github.com/repos/ManageIQ/manageiq/issues/2543/events","html_url":"https://github.com/ManageIQ/manageiq/pull/2543","id":66916934,"number":2543,"title":"Eager loading","user":{"login":"brandondunne","id":651659,"avatar_url":"https://avatars.githubusercontent.com/u/651659?v=3","gravatar_id":"","url":"https://api.github.com/users/brandondunne","html_url":"https://github.com/brandondunne","followers_url":"https://api.github.com/users/brandondunne/followers","following_url":"https://api.github.com/users/brandondunne/following{/other_user}","gists_url":"https://api.github.com/users/brandondunne/gists{/gist_id}","starred_url":"https://api.github.com/users/brandondunne/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brandondunne/subscriptions","organizations_url":"https://api.github.com/users/brandondunne/orgs","repos_url":"https://api.github.com/users/brandondunne/repos","events_url":"https://api.github.com/users/brandondunne/events{/privacy}","received_events_url":"https://api.github.com/users/brandondunne/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/ManageIQ/manageiq/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":10,"created_at":"2015-04-07T15:31:16Z","updated_at":"2015-04-22T23:41:59Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/ManageIQ/manageiq/pulls/2543","html_url":"https://github.com/ManageIQ/manageiq/pull/2543","diff_url":"https://github.com/ManageIQ/manageiq/pull/2543.diff","patch_url":"https://github.com/ManageIQ/manageiq/pull/2543.patch"},"body":"Moved all eager loading of STI trees to ActiveSupport::Dependencies.const_missing\r\nWe have a lot of problems with STI trees not being fully loaded since we do not eager load everything (especially in development mode). In addition that requires developers to remember to require all subclasses (and only direct subclasses) of their new models (and to do it properly). As you can see from the deletions, this is widely problematic. This is a hack on const_missing which is admittedly dirty, but at least puts all logic in one place. Hooking const_missing also allows Rails model reloading when changing files in dev mode to work properly (where an initializer approach would not work).\r\n\r\nhttps://bugzilla.redhat.com/show_bug.cgi?id=1207259"},"comment":{"url":"https://api.github.com/repos/ManageIQ/manageiq/issues/comments/95368306","html_url":"https://github.com/ManageIQ/manageiq/pull/2543#issuecomment-95368306","issue_url":"https://api.github.com/repos/ManageIQ/manageiq/issues/2543","id":95368306,"user":{"login":"matthewd","id":1034,"avatar_url":"https://avatars.githubusercontent.com/u/1034?v=3","gravatar_id":"","url":"https://api.github.com/users/matthewd","html_url":"https://github.com/matthewd","followers_url":"https://api.github.com/users/matthewd/followers","following_url":"https://api.github.com/users/matthewd/following{/other_user}","gists_url":"https://api.github.com/users/matthewd/gists{/gist_id}","starred_url":"https://api.github.com/users/matthewd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matthewd/subscriptions","organizations_url":"https://api.github.com/users/matthewd/orgs","repos_url":"https://api.github.com/users/matthewd/repos","events_url":"https://api.github.com/users/matthewd/events{/privacy}","received_events_url":"https://api.github.com/users/matthewd/received_events","type":"User","site_admin":false},"created_at":"2015-04-22T23:41:59Z","updated_at":"2015-04-22T23:41:59Z","body":"For the record, I really think the best solution here is less magic, rather than more. ¯\\\\\\_(ツ)_/¯ "}}