Method: Model#valid_children
- Defined in:
- lib/yodel/models/core/model/model.rb
#valid_children ⇒ Object
Returns an array of all allowed children and descendants of those children. This list respects both allowed_children and allowed_parents restrictions, so Page (which allows children that are descendants of Page) won’t include Article which can only exist under a Blog page, even though Article is a descendant of Page.
212 213 214 |
# File 'lib/yodel/models/core/model/model.rb', line 212 def valid_children allowed_children_and_descendants.select {|child| child.allowed_parent?(self)} end |