Open
Description
When trying to load hash_tree as much effectively as can I came into an issue.
In model I have set order option act_as_tree order: 'name'
And then when trying to call Right.includes(:self_and_descendants)
mysql throws error:
Unknown column 'name' in 'order clause
That's because ActiveRecord are trying to preload rIght_hierarchies without joining the model (Right) table.
I triet to dig into the code and find the bug. But only found that in closure_tree/model.rb
there is _ct.has_many_with_order_option
when defining has_many association on model.
Couldn't find out the way how to implement it to work with preloading and also preserve ordering feature on preloaded models.
Any ideas ?