lib/netzke/tree_panel.rb in netzke-basepack-0.5.6 vs lib/netzke/tree_panel.rb in netzke-basepack-0.5.7
- old
+ new
@@ -16,10 +16,10 @@
:loader => {:data_url => global_id+"__get_children".l}
})
end
def get_children(params)
- klass = config[:data_class_name].constantize
+ klass = config[:model].constantize
node = params[:node] == 'source' ? klass.find_by_parent_id(nil) : klass.find(params[:node].to_i)
node.children.map{|n| {:text => n.name, :id => n.id, :leaf => n.children.empty?}}
end
end
\ No newline at end of file