Closed Ewg777 closed 8 years ago
Should that be configured instead like the following?
ActiveAdmin.register Item, :as => "MyItem" do
# ...
end
Digging through the various methods used in registering a resource I'm unable to find where the :class
option would be used:
Any update here @Ewg777 ?
By the way, @zorab47 does this lib support nodes instanced of different classes?
What do you mean? In the case of models using single table inheritance it should work properly. But I'm not sure of other cases.
ActiveAdmin.register MyItem do
sortable :tree => true,
:sortable => true,
:children_method => :make_children,
...
class MyItem < ActiveRecord::Base
def make_children
SomeOtherClass.all
end
...
Saving in this case doesn't work properly
Correct. That would not work because the Resource's sort action assumes it is sorting nodes of the same type as the Resource.
Using something like Global ID may be an option to properly find each node in the hierarchy.
the lib trying to update positions for MyItem.