I’m developing a plugin to the Rails (6.1.7) project Foreman (v3.5.1; based on the Foreman Plugin Template) and face the issue that one of my modules (DnsInterfaceExtensions
) ought to be prepended to a Foreman module. Problem is, even after prepend
, DnsInterfaceExtensions
does not show up as an ancestor to Foreman’s DnsInterface
(in the Rails console):
irb(main):001:0> DnsInterface.ancestors
=> [DnsInterface]
irb(main):002:0> DnsInterface.prepend ForemanCnames::Concerns::DnsInterfaceExtensions
=> DnsInterface
irb(main):003:0> DnsInterface.ancestors
=> [DnsInterface]
irb(main):005:0> DnsInterface.prepend Module.new
=> DnsInterface
irb(main):006:0> DnsInterface.ancestors
=> [#<Module:0x0000558ef346d9d0>, DnsInterface]
I’ve tried defining DnsInterfaceExtensions#prepended
, which evidently is executed, but the new class methods are not added to DnsInterface
, nor is the module’s constant :RECORD_TYPE
overridden. Without any errors from Ruby, I’m clueless what the reason for this outcome is. Any ideas?
Thank you for your time,
Xavier.