Project

General

Profile

Actions

Bug #12328

closed

Host STI does not work in engine initializers

Added by Marek Hulán over 8 years ago. Updated almost 6 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Plugin integration
Target version:
Difficulty:
Triaged:
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
Actions #1

Updated by The Foreman Bot over 8 years ago

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

Updated by Marek Hulán over 8 years ago

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

Updated by Marek Hulán over 8 years ago

  • translation missing: en.field_release set to 71
Actions

Also available in: Atom PDF