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