This would better written as a scope:

`scope :roots, -> { where(parent_id: nil) }`