Module: Xylem::ClassMethods
- Defined in:
- lib/xylem.rb
Instance Method Summary collapse
Instance Method Details
#leaves ⇒ Object
66 67 68 69 |
# File 'lib/xylem.rb', line 66 def leaves t = arel_table where(t[:id].not_in(t.project([t[:parent_id]]).where(t[:parent_id].not_eq(nil)).distinct)) end |
#root ⇒ Object
58 59 60 |
# File 'lib/xylem.rb', line 58 def root roots.first end |
#roots ⇒ Object
62 63 64 |
# File 'lib/xylem.rb', line 62 def roots where(parent: nil) end |