app/models/mixins/relationship_mixin.rb
# Returns the parent of the record, nil for a root node
Returns the parent of the record, nil for a root node
Returns the parent of the record nil for a root node
def parent(*args)
    rels = parents(*args).take(2)
    raise _("Multiple parents found.") if rels.length > 1
    rels.first
  end
def parent ( * args ) rels = parents ( * args ) . take ( 2 ) raise _ ( "Multiple parents found." ) if rels . length > 1 rels . first end
Returns the parent of the record, nil for a root node
Returns the parent of the record nil for a root node
args
<not_specific>