Hello,

lately I was switching plugins on and off, and I stumbled upon an annoying 
issue: Many plugins that add some STI classes (for example Katello that 
adds settings, or Discovery that adds DiscoveredHost).
A problem starts when such a plugin is removed from the system, since 
default STI implementation will throw an error if it can't load a class 
that corresponds to the :type column in the DB.

I propose a custom handling for such cases, since they are not exactly 
exceptions in our system design.
I was thinking about one of the following options to handle this case, and 
would like to see a voting which one you prefer. Of course other options 
can be proposed too.

1. Return a base class for such records (Maybe with an error already set)
2. Return nil/some kind of special AR object for such records (will require 
defensive coding while handling heterogeneous lists)
3. Filter those records out with default scope (will require more 
declaration in plugins, or more DB queries on system startup)

Any thoughts in this area will be much appreciated,

Shim

-- 
You received this message because you are subscribed to the Google Groups 
"foreman-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to