Module: Locomotive::Concerns::Page::Tree::PatchedTreeMethods
- Defined in:
- app/models/locomotive/concerns/page/tree.rb
Instance Method Summary collapse
- #ancestors ⇒ Object
-
#siblings_and_self ⇒ Mongoid::Criteria
Returns this document’s siblings and itself, all scoped by the site.
Instance Method Details
#ancestors ⇒ Object
32 33 34 35 |
# File 'app/models/locomotive/concerns/page/tree.rb', line 32 def ancestors # https://github.com/benhutton/mongoid-tree/commit/acb6eb0440dc003cd8536cb8cc6ff4b16c9c9402 super.order_by(:depth.asc) end |
#siblings_and_self ⇒ Mongoid::Criteria
Returns this document’s siblings and itself, all scoped by the site
41 42 43 |
# File 'app/models/locomotive/concerns/page/tree.rb', line 41 def siblings_and_self base_class.where(parent_id: self.parent_id, site_id: self.site_id) end |