You can try changing the definitions of relationships as follows:
has_many :child_sites, :class_name => 'Site', :cyclic => true belongs_to :parent_site, :class_name => 'Site', :cyclic => true
I donβt know exactly what he is doing, but I remember that this was discussed in the google google group. If this does not work, try setting inverse_of to relation macros. In most cases, setting inverse_of does the job correctly.
has_many :child_sites, :class_name => 'Site', :inverse_of => :parent_site belongs_to :parent_site, :class_name => 'Site', :inverse_of => :child_sites
About additional requests, yes, there will be additional requests when you want to receive the child_sites of the site or the parent site of the site.
You should consider embedding the child sites in the parent site, but keep in mind that you will lose the ability to request child sites using stand-alone. You always had to refer to any child site as parent_site> child_sites.
Also, consider the 16 MB document size limit, which is difficult to access, but may be possible if there are many child sites for the parent, and if you store template information, for example, html, css, etc. in the document itself.
source share