|
Revision 7452, 0.5 kB
(checked in by david, 1 year ago)
|
Turned ActiveRecord::Acts::NestedSet into a plugin #9516 [josh]
|
| Line | |
|---|
| 1 |
ActsAsNestedSet |
|---|
| 2 |
============== |
|---|
| 3 |
|
|---|
| 4 |
This acts_as extension provides Nested Set functionality. Nested Set is similiar to Tree, but with the added feature that you can select the children and all of their descendents with a single query. A good use case for this is a threaded post system, where you want to display every reply to a comment without multiple selects. |
|---|
| 5 |
|
|---|
| 6 |
|
|---|
| 7 |
Example |
|---|
| 8 |
======= |
|---|
| 9 |
|
|---|
| 10 |
class Product < ActiveRecord::Base |
|---|
| 11 |
acts_as_nested_set |
|---|
| 12 |
end |
|---|
| 13 |
|
|---|
| 14 |
|
|---|
| 15 |
Copyright (c) 2007 David Heinemeier Hansson, released under the MIT license |
|---|