This repository is private.
All pages are served over SSL and all pushing and pulling is done over SSH.
No one may fork, clone, or view it unless they are added as a member.
Every repository with this icon (
) is private.
Every repository with this icon (
This repository is public.
Anyone may fork, clone, or view it.
Every repository with this icon (
) is public.
Every repository with this icon (
Converting Acts_As_Tree to Awesome_Nested_Set
To convert a table that is established as a tree using acts_as_tree to an awesome_nested_set is a relatively simple process.
- Install the awesome_nested_set plugin.
- Generate, edit and run a migration to add the columns `lft` and `rgt` to your Model. The column `parent_id` should already exist and be populated with your tree relationships.
- if you used acts_as_ordered_tree plugin you need to change your parent_id column “0” values to NULL in the database
- In either the console, or a controller action, simply execute YourModel.rebuild!
This will send the plugin through your table and populate the `lft` and `rgt` columns with the appropriate values.
Thanks for writing an excellent plugin and providing this simple feature. I hope these instructions will make someones transfer a lot easier!






