acts_as_ordered_tree icon indicating copy to clipboard operation
acts_as_ordered_tree copied to clipboard

Documentation support

Open brendon opened this issue 11 years ago • 5 comments

Hi Alexey,

Just following up my offer to help you with your documentation.

In terms of your README, would you be able to give me a list of features that you want to highlight that aren't already in there? I can then use this as a basis for expanding on those features :)

Unfortunately I've not had any time to work on my project that uses aaot but I hope to test out your new features soon :) I guess that's the problem when the developer also has to run the company! Hopefully I'll have enough coming in to hire a developer one day! :D

Have a great day!

Brendon

brendon avatar Mar 09 '14 21:03 brendon

Hi Brendon,

First, thanks for you support!

Current README lacks of description of following things:

  1. #arrange method (#22).
  2. Recursive queries DSL (#21). Actually, I almost decoupled this part into separate library (please, take a look at https://github.com/take-five/activerecord-hierarchical_query).
  3. .acts_as_ordered_tree method options
  4. New iterators: #each_with_level and #each_without_orphans (https://github.com/take-five/acts_as_ordered_tree/commit/a734126dee0ade0f9276602ed66f9693cf89251f)
  5. New setters: #left_sibling= and #right_sibling=

Also I've planned to include into README comparison of hierarchical DB data structures, where benefits of Adjacency List model could be described, and where one could learn why AAOT should be used instead of, for example, awesome_nested_set.

Another thing I wanted to do with README is to split features description into separate sections:

  1. Tree traversal (#children, #parent, #descendants, #ancestors, recursive queries, #each_with_level iterator etc)
  2. Node predicates (#leaf?, #is_ancestor_of? etc)
  3. Node movements (#move_to_child_of, #move_to_root, #move_to_left_of etc)
  4. Node callbacks:
  • before_move, before_reorder, after_move, after_reorder

  • Callbacks added via .acts_as_ordered_tree method:

    class MyModel < ActiveRecord::Base
      acts_as_ordered_tree :before_add => :execute_before_add, :before_remove => :execute_before_remove
    
      def execute_before_add(new_children)
      end
    
      def execute_before_remove(destroyed_children)
      end
    end
    
  • Callbacks order

  1. Create and update tree node: what happens under the hood.

I'd be very grateful if you could help with at least something out of this.

take-five avatar Mar 10 '14 09:03 take-five

Thanks Alexey, I will certainly help. Just in the process of relocating from NZ to Canada but once we're settled there in a couple of weeks I'll chip away at it :)

On Mon, Mar 10, 2014 at 10:29 PM, Alexey Mihaylov [email protected]:

Hi Brendon,

First, thanks for you support!

Current README lacks of description of following things:

  1. #arrange method (#22https://github.com/take-five/acts_as_ordered_tree/issues/22).
  2. Recursive queries DSL (#21https://github.com/take-five/acts_as_ordered_tree/issues/21). Actually, I almost decoupled this part into separate library (please, take a look at https://github.com/take-five/activerecord-hierarchical_query).
  3. .acts_as_ordered_tree method options
  4. New iterators: #each_with_level and #each_without_orphans (a734126https://github.com/take-five/acts_as_ordered_tree/commit/a734126dee0ade0f9276602ed66f9693cf89251f )
  5. New setters: #left_sibling=https://github.com/take-five/acts_as_ordered_tree/commit/845ed3133c35eb129822d5114693b3ffa8bbb065#diff-5f950f0660271e1d3936c4a950d84423R46and #right_sibling=https://github.com/take-five/acts_as_ordered_tree/commit/845ed3133c35eb129822d5114693b3ffa8bbb065#diff-5f950f0660271e1d3936c4a950d84423R90

Also I've planned to include into README comparison of hierarchical DB data structures, where benefits of Adjacency List model could be described, and where one could learn why AAOT should be used instead of, for example, awesome_nested_set.

Another thing I wanted to do with README is to split features description into separate sections:

  1. Tree traversal (#children, #parent, #descendants, #ancestors, recursive queries, #each_with_level iterator etc)
  2. Node predicates (#leaf?, #is_ancestor_of? etc)
  3. Node movements (#move_to_child_of, #move_to_root, #move_to_left_of etc)
  4. Node callbacks:
  • before_move, before_reorder, after_move, after_reorder

    Callbacks added via .acts_as_ordered_tree method:

    class MyModel < ActiveRecord::Base acts_as_ordered_tree :before_add => :execute_before_add, :before_remove => :execute_before_remove

    def execute_before_add(new_children) end

    def execute_before_remove(destroyed_children) endend

    • Callbacks order
  1. Create and update tree node: what happens under the hood.

I'd be very grateful if you could help with at least something out of this.

Reply to this email directly or view it on GitHubhttps://github.com/take-five/acts_as_ordered_tree/issues/31#issuecomment-37164874 .

brendon avatar Mar 20 '14 20:03 brendon

I'm evaluating this gem and also comparing with closure_tree. I was wondering if there documentation on whether this gem is thread safe or not in rails 4.2 ? Thanks

amf9t2 avatar Jun 08 '16 17:06 amf9t2

@amf9t2 version from master branch should be threadsafe

take-five avatar Jun 08 '16 21:06 take-five

@take-five Thank you for the quick response.

amf9t2 avatar Jun 08 '16 21:06 amf9t2