{"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-24T14:43:09Z","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/95951797","html_url":"https://github.com/ManageIQ/manageiq/pull/2543#issuecomment-95951797","issue_url":"https://api.github.com/repos/ManageIQ/manageiq/issues/2543","id":95951797,"user":{"login":"miq-bot","id":7806257,"avatar_url":"https://avatars.githubusercontent.com/u/7806257?v=3","gravatar_id":"","url":"https://api.github.com/users/miq-bot","html_url":"https://github.com/miq-bot","followers_url":"https://api.github.com/users/miq-bot/followers","following_url":"https://api.github.com/users/miq-bot/following{/other_user}","gists_url":"https://api.github.com/users/miq-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/miq-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/miq-bot/subscriptions","organizations_url":"https://api.github.com/users/miq-bot/orgs","repos_url":"https://api.github.com/users/miq-bot/repos","events_url":"https://api.github.com/users/miq-bot/events{/privacy}","received_events_url":"https://api.github.com/users/miq-bot/received_events","type":"User","site_admin":false},"created_at":"2015-04-24T14:43:09Z","updated_at":"2015-04-24T14:43:09Z","body":"<rubocop />Checked commits https://github.com/brandondunne/manageiq/commit/e1a65071ef8cbb05e144819c1b33eee3b986789b .. https://github.com/brandondunne/manageiq/commit/0022a7a59803410e01148e696f022ba234baf6d2 with rubocop 0.27.1\n33 files checked, 8 offenses detected\n\n**vmdb/app/controllers/vm_common.rb**\n- [ ] :small_blue_diamond: - [Line 1491](https://github.com/brandondunne/manageiq/blob/0022a7a59803410e01148e696f022ba234baf6d2/vmdb/app/controllers/vm_common.rb#L1491), Col 121 - [Metrics/LineLength](http://rubydoc.info/gems/rubocop/0.27.1/RuboCop/Cop/Metrics/LineLength) - Line is too long. [140/120]\n- [ ] :small_blue_diamond: - [Line 1499](https://github.com/brandondunne/manageiq/blob/0022a7a59803410e01148e696f022ba234baf6d2/vmdb/app/controllers/vm_common.rb#L1499), Col 121 - [Metrics/LineLength](http://rubydoc.info/gems/rubocop/0.27.1/RuboCop/Cop/Metrics/LineLength) - Line is too long. [142/120]\n\n**vmdb/app/models/miq_request_task.rb**\n- [ ] :large_orange_diamond: - [Line 18](https://github.com/brandondunne/manageiq/blob/0022a7a59803410e01148e696f022ba234baf6d2/vmdb/app/models/miq_request_task.rb#L18), Col 42 - [Style/PercentLiteralDelimiters](http://rubydoc.info/gems/rubocop/0.27.1/RuboCop/Cop/Style/PercentLiteralDelimiters) - `%w`-literals should be delimited by `(` and `)`\n- [ ] :small_blue_diamond: - [Line 205](https://github.com/brandondunne/manageiq/blob/0022a7a59803410e01148e696f022ba234baf6d2/vmdb/app/models/miq_request_task.rb#L205), Col 121 - [Metrics/LineLength](http://rubydoc.info/gems/rubocop/0.27.1/RuboCop/Cop/Metrics/LineLength) - Line is too long. [144/120]\n\n**vmdb/lib/extensions/as_const_missing_with_sti.rb**\n- [ ] :small_blue_diamond: - [Line 44](https://github.com/brandondunne/manageiq/blob/0022a7a59803410e01148e696f022ba234baf6d2/vmdb/lib/extensions/as_const_missing_with_sti.rb#L44), Col 121 - [Metrics/LineLength](http://rubydoc.info/gems/rubocop/0.27.1/RuboCop/Cop/Metrics/LineLength) - Line is too long. [126/120]\n- [ ] :small_blue_diamond: - [Line 52](https://github.com/brandondunne/manageiq/blob/0022a7a59803410e01148e696f022ba234baf6d2/vmdb/lib/extensions/as_const_missing_with_sti.rb#L52), Col 3 - [Metrics/AbcSize](http://rubydoc.info/gems/rubocop/0.27.1/RuboCop/Cop/Metrics/AbcSize) - Assignment Branch Condition size for class_inheritance_relationships is too high. [16.58/15]\n- [ ] :small_blue_diamond: - [Line 72](https://github.com/brandondunne/manageiq/blob/0022a7a59803410e01148e696f022ba234baf6d2/vmdb/lib/extensions/as_const_missing_with_sti.rb#L72), Col 121 - [Metrics/LineLength](http://rubydoc.info/gems/rubocop/0.27.1/RuboCop/Cop/Metrics/LineLength) - Line is too long. [122/120]\n\n**vmdb/lib/report_formatter/timeline.rb**\n- [ ] :small_blue_diamond: - [Line 108](https://github.com/brandondunne/manageiq/blob/0022a7a59803410e01148e696f022ba234baf6d2/vmdb/lib/report_formatter/timeline.rb#L108), Col 13 - [Metrics/BlockNesting](http://rubydoc.info/gems/rubocop/0.27.1/RuboCop/Cop/Metrics/BlockNesting) - Avoid more than 3 levels of block nesting.\n"}}