Whelp, I drudged through a solution.
In Item model:
belongs_to :manager, :polymorphic => true
# Override local methods with Manager object methods
[:barcode, :name, :price, :sale_price, :stock, :taxed, :tax_included].each do |att|
define_method(att) do
if manager_id.blank?
read_attribute(att)
else
manager.send(att)
end
end
end
In items table, added:
manager_id :integer
manager_type :string
And it seems to be working OK. One thing to note though, is that eager loading the polymorphic association fails if I specifically try to use order('categories.name')
for some reason - even though the categories table doesn't have anything to do with the engine model. Otherwise it's good.