Closed Bizcho closed 2 years ago
So this is a pretty print kind of thing?
It looks nice
Yes a friend of mine is using this gem for nesting components and wanted a better way of debuggin the tree. Hope it gets added to the main repo
thanks
@Bizcho Hey,
Do you have any docs on using this? /cc @epugh
Hello @kbrock I dont have any Docs but the basic idea is to call the method tree_view and pass a symbold that is a property od the class you are using. like in the first coment.
Class Message has two atributes id and content, So you could call
message.subtree.tree_view(:content)
or
message.subtree.tree_view(:id)
the result is built with the toString() of whaterever atribute you passed to the method
hope my awnser is sufficent,
I unfortunantly get:
ERROR TriesAncestryLifecycleTest#test_create_200_tries_behavior (1.25s)
Minitest::UnexpectedError: NoMethodError: undefined method `tree_view' for #<ActiveRecord::Relation []>
test/integration/tries_ancestry_lifecycle_test.rb:21:in `block in <class:TriesAncestryLifecycleTest>'
Here is the (commented out!) use of this command: https://github.com/o19s/quepid/blob/ancestry_column_too_short/test/integration/tries_ancestry_lifecycle_test.rb#L21
@epugh I'm curious, is the ancestry
column getting properly in your test?
i.e. If you add a puts try.ancestry
after the try.save!
does it keep getting longer and longer?
also the use of the try
variable is fine, but it does make me nervous for the try()
method defined via ActiveSupport
Could you paste the code that is failing for you? That link no longer shows the line commented out
This adds the funcionality for: #559. For Example:
arrange method:
tree_view method: