lib/model/api.js
function getRootModelName (model) {
    if (!model) {
      throw new Error('Please provide Arrow Model')
    }

    const namespaceDelimiter = '/'
    var parent = model
    while (parent._parent && parent._parent.name) {
      parent = parent._parent
    }
    if (!parent.name) {
      throw new Error('The provided model has no name or parent with name')
    }
    const name = parent.name.split(namespaceDelimiter).pop()
    return {
      nameOnly: name,
      nameOnlyPlural: pluralize(name),
      withNamespace: parent.name
    }
  }
function getRootModelName (model) {
    if (!model) {
      throw new Error('Please provide Arrow Model')
    }

    const namespaceDelimiter = '/'
    var parent = model
    while (parent._parent && parent._parent.name) {
      parent = parent._parent
    }
    if (!parent.name) {
      throw new Error('The provided model has no name or parent with name')
    }
    const name = parent.name.split(namespaceDelimiter).pop()
    return {
      nameOnly: name,
      nameOnlyPlural: pluralize(name),
      withNamespace: parent.name
    }
  }
function getRootModelName ( model ) { if ( ! model ) { throw new Error ( 'Please provide Arrow Model' ) } const namespaceDelimiter = '/' var parent = model while ( parent . _parent && parent . _parent . name ) { parent = parent . _parent } if ( ! parent . name ) { throw new Error ( 'The provided model has no name or parent with name' ) } const name = parent . name . split ( namespaceDelimiter ) . pop ( ) return { nameOnly : name , nameOnlyPlural : pluralize ( name ) , withNamespace : parent . name } }
Gets parent model name or if the model has no parent the model name itself.

@param {Arrow.Model} model the model which name must be evaluated
@return {Object} object literal that contains the clean and namespaced model name
Gets parent model name or if the model has no parent the model name itself .