Project

General

Profile

Bug #12328

Host STI does not work in engine initializers

Added by Marek Hulán almost 4 years ago. Updated about 1 year ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Plugins-Engines
Target version:
Difficulty:
Triaged:
Bugzilla link:
Team Backlog:
Fixed in Releases:
Found in Releases:

Description

When I use Host::Base.descendants I expect to return all descendants (at least those defined in core) but we don't load these classes. This is usually an issue in engines if you need to work with descendants in initializers, until Host::Managed was referenced from somewhere. Simple solution is to use require_dependency 'host/managed' as for other STI. To reproduce, just start rails console in development mode and run

Host::Base.descendants

Associated revisions

Revision 7fff2188 (diff)
Added by Marek Hulán almost 4 years ago

Fixes #12328 - host STI loads subclasses

History

#1 Updated by The Foreman Bot almost 4 years ago

  • Status changed from Assigned to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/2868 added
  • Pull request deleted ()

#2 Updated by Marek Hulán almost 4 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

#3 Updated by Marek Hulán almost 4 years ago

  • Legacy Backlogs Release (now unused) set to 71

Also available in: Atom PDF