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

Also available in: Atom PDF