Better nested set
http://agilewebdevelopment.com/plugins/betternestedset
ããã«ããã¾ããã©ããããã®ãã¨ããã¨ãacts_as_nested_setãæ¡å¼µãã¦
便å©ã«ãããã®ã§ãã
acts_as_nested_set + acts_as_tree + 便å©= better_nested_set
ã¨ãã£ãæãã§ãã
ã¤ã³ã¹ãã¼ã«æ¹æ³
./script/plugin install http://opensource.symetrie.com/svn/better_nested_set/trunk
ãã ãtrunkã¨ããååã«ãªãã®ã§ããªãã¼ã ããæ¹ãããæ°ããã¾ãã
使ããã¡ã½ããä¸è¦§
- move_to_child_of å¥ã®å ´æã«ã¶ãä¸ãã
- move_to_right_ofå¥ã®å ´æã«ã¶ãä¸ãã
- move_to_left_ofå¥ã®å ´æã«ã¶ãä¸ãã
- root ä¸çªå ã®è¦ª
- roots ä¸çªãããã®è¦ªãé åã§è¿ã
- level æã®æ·±ã
- ancestors ä¸çªå ã®è¦ªããç´æ¥ã®è¦ªã¾ã§ã®é å
- self_and_ancestors ä¸ï¼èªå
- siblings èªåã¨åãã¬ãã«ã®è¦ç´ ã®é å
- self_and_siblings ä¸ï¼èªå
- children_count åã®æ°
- children ç´æ¥ã®åã®é å
- all_children åãã¹ã¦ã®é åï¼å«ãªã©ãå«ãï¼
- left_col_name å·¦ã®åå
- right_col_name å³ã®åå
- parent_col_name 親ã®åå