app/models/record_category.rb
# Returns this category as a child of parent
Returns this category as a child of parent
Returns this category as a child of parent
def as_child(parent)
    x = self
    return x if x == parent 
    while x.parent and x.parent != parent
      x = x.parent
    end
    if x.parent == parent
      x
    end
  end
def as_child ( parent ) x = self return x if x == parent while x . parent and x . parent != parent x = x . parent end if x . parent == parent x end end
Returns this category as a child of parent
Returns this category as a child of parent
parent
<not_specific>