Update usage of RubyTree to avoid deprecated methods
This commit is contained in:
@ -45,8 +45,8 @@ class FileTree
|
||||
icon: node_icon(node),
|
||||
id: node.content.try(:ancestor_id),
|
||||
state: {
|
||||
disabled: !node.is_leaf?,
|
||||
opened: !node.is_leaf?,
|
||||
disabled: !node.leaf?,
|
||||
opened: !node.leaf?,
|
||||
},
|
||||
text: node.name,
|
||||
}
|
||||
@ -54,7 +54,7 @@ class FileTree
|
||||
private :map_to_js_tree
|
||||
|
||||
def node_icon(node)
|
||||
if node.is_leaf? && !node.is_root?
|
||||
if node.leaf? && !node.root?
|
||||
file_icon(node.content)
|
||||
else
|
||||
folder_icon
|
||||
|
@ -90,7 +90,7 @@ describe FileTree do
|
||||
end
|
||||
|
||||
it 'creates tree nodes for intermediary path segments' do
|
||||
expect(file_tree.instance_variable_get(:@root).reject(&:content).reject(&:is_root?).map(&:name)).to eq(files.first.path.split('/'))
|
||||
expect(file_tree.instance_variable_get(:@root).reject(&:content).reject(&:root?).map(&:name)).to eq(files.first.path.split('/'))
|
||||
end
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user