Hi
I have the following structure (Disclaimer: the DB-Model is not my Idea…) A table with channels, referencing itself with HABTM A table with packages, referencing channels with HABTM like this:
class Channel < ApplicationRecord
has_and_belongs_to_many :childs, :class_name => "Channel", :join_table => "clonings", :foreign_key => 'orig_id', :association_foreign_key => 'id_id'
has_and_belongs_to_many :parents, :class_name => "Channel", :join_table => "clonings", :foreign_key => 'id_id', :association_foreign_key => 'orig_id'
has_and_belongs_to_many :packages
has_many :parent_packages, :class_name => "Package", :through => :parents
end
Requesting childs, parents and packages works, but requesting parent_packages fails with
chain-habtm(dev)> x.parent_packages
/home/jan/nobackup/gems/gems/irb-1.15.2/lib/irb.rb:406:in 'full_message': stack level too deep (SystemStackError)
chain-habtm(dev)>
I know that the design of the DB is not perfect but i cannot change it as it is from an existing Application (uyuni, the successor of spacewalk from suse). Is there anything i can do to resolve that issue?
Thanks, Jan