Skip to content

A method for checking if an object is an intermediate object between root and leaf? #141

Open
@AlexVPopov

Description

@AlexVPopov

I have a multi-level tag hierarchy and I happened to need to know if a tag is a parent of sub-tags, but not a root. I ended up adding this to the Tag model:

def intermediate?
  !self.root? && !self.leaf?
end

I think that something similar would be a good idea as an instance method in the gem.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions